ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting bytes into a Global String

Hi,

 

I need to send the next command to my device (bytes): 0x55 0x55 b1 b2 where b1 and b2 are 8 bits command/values 

 

b1 = xxxx c3 c2 c1 c0 (control some internal switches in the device)

b2 = v7 v6 v5 v4 v3 v2 v1 v0 (control some calibration values for the device)

 

I'm using 4 switches for b1 and for now b2 = 0. I'm writing the result value from the switches to a Global Variable (VAR_1) and I want to put that result into a Global String to be sent by the RS232 Output Module using an Event. But I don't know how to put that byte into the Global String I was trying "Calculate Expression Automatically" with no success.

Remembering the HEX function in Visual Basic maybe something like "UU"+ HEX(${VAR_1}) + HEX(0).

 

Screenshot attached.

 

Any help?

 

Thanks

 

 

 

0 Kudos
Message 1 of 2
(6,333 Views)

Solved! using Output Format Data UU[w] and Global Variable VAR_3= VAR_1*256+VAR_2

 

Thanks

0 Kudos
Message 2 of 2
(6,325 Views)