LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

8 bit Unsigned integer issue

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

 

 

 

Anil8899_0-1640262275722.png

 

 

thanks ...

 

0 Kudos
Message 1 of 3
(1,286 Views)

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

0 Kudos
Message 2 of 3
(1,281 Views)

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).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
0 Kudos
Message 3 of 3
(1,246 Views)