12-23-2021 06:25 AM
Hello all,
I am working on PCAN device and i need to set current by sending CAN commands via PCAN device,
problem is i am not able convert the decimal value of (500mA) and add it to the 8 byte of command sequence .
attaching the image and vi , please suggest me some solutions
thanks ...
12-23-2021 06:37 AM
The output of the string to number is an I64 data type (signed number made up of 64 bits)
You need for your mA value to be a U16 number to get the output in your array constant.
Have a look at the attached
12-23-2021 11:12 AM - edited 12-23-2021 11:13 AM
Personally, I would rather use an array constant for the entire command and then use Replace Array Subset to create the command data.
Other advice:
Whenever you are not using the Decimal format for integers, show the radix (right-click, Visible Items->Radix). This will tell you what format the integer is in. Then you won't be guessing if 12 was actually 18 (12 hex) or 12 (12 decimal) or even 10 (12 octal).