Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

IO-instructions for analog output

#1
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.


Attached Files Thumbnail(s)

#2
The lastest version of RoboDK (Windows 64 bit) published 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.
#3
Hi Albert,
the new feature works perfectly. Thanks a lot for the implementation!




Users browsing this thread:
3 Guest(s)