RoboDK Forum
IO-instructions for analog output- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK bugs (//www.sinclairbody.com/forum/Forum-RoboDK-bugs)
+--- Thread: IO-instructions for analog output (/Thread-IO-instructions-for-analog-output)



IO-instructions for analog output-DavidG-06-01-2019

Hi,
I changed my robot driver according to Albert's suggestion in order to support analog output ->Related Thread
For testing purposes I created a program using the RoboDK GUI and noticed that RoboDK seems to treat the IO-value as an integer. Please see the screenshots attached.
When using decimals I get 0V output voltage for the given examples. As a workaround I multiplied the values by 1,000,000 and transformed them to integers. Inside the robot driver I divide them by 1,000,000 again and everything works fine.

Code:
CASE 10
COM_ACTCNT = COM_ACTCNT + 1
io_id = COM_VALUE1
IF io_id >= 20 THEN
COM_VALUE2 = COM_VALUE2 / 1000000
$ANOUT[io_id] = COM_VALUE2
ELSE
IF COM_VALUE2 > 0.5 THEN
$OUT[io_id] = TRUE
ELSE
$OUT[io_id] = FALSE
ENDIF
ENDIF
COM_ACTION = 0

It is not necessarily a bug, more like a suggestion for improvement. It would be comfortable if the IO-instructions would accept decimal values straightforward.


RE: IO-instructions for analog output-Albert-06-10-2019

的最新版本RoboDK (Windows 64位)酒吧lished today should allow you to pass digital output values as decimal values. Let me know if you can't manage Analog Outputs without this workaround.


RE: IO-instructions for analog output-DavidG-06-20-2019

Hi Albert,
the new feature works perfectly. Thanks a lot for the implementation!