LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa write in hexdecimal

Solved!
Go to solution

Hello,

 

i want to send command in visa write in hexadecimal. my command format is like \02\1F\highbyte\lowbyte\03.

these high and low byte i have to take from user in decimal array and convert in hexadecimal and by using concatenation. but i am having problem with \ i am not getting this so if any one can help. 

Download All
0 Kudos
Message 1 of 13
(2,526 Views)

the \ is codes display, not exactly hex values.

 

To get that right click on string control, select properties and choose codes display. For string constant just right click and select codes display.

 

Here is how to convert between formats for your highbyte/lowbyte.

0 Kudos
Message 2 of 13
(2,519 Views)

i used \ code display but i am not getting \ between high and low byte. i have attached my result.

0 Kudos
Message 3 of 13
(2,514 Views)

Hi malik,

 


@malik240 wrote:

i used \ code display but i am not getting \ between high and low byte. i have attached my result.


When you don't get the expected result then you did something wrong!

As you didn't attach your VI so far we cannot debug it for you - you need to debug on your own…

 

(Keep in mind: images of (parts of) code is pretty useless as we cannot edit/run/debug them with LabVIEW!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 13
(2,509 Views)

The command packet must be exactly 5 bytes long. Set the string display mode to Hex to see what's your mistake. The backslash is not to be sent, it acts only as a visual delimiter for the Codes string display.

Please post your vi or a simplified version where you build the command.

If you insist to post images, let the display mode be visible on string indicators and constants (right click -> Visible -> Display Style), otherwise it's impossible to say what is the actual string value.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 13
(2,499 Views)

here i s VI.

0 Kudos
Message 6 of 13
(2,482 Views)

Hi malik,

 

you have been told to make the display mode indication visible on all string controls/indicators/constants - but you failed in doing so!

 

See this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 13
(2,471 Views)
Solution
Accepted by malik240

I believe what you are after is this.

 

0 Kudos
Message 8 of 13
(2,453 Views)

yes you are right but i want to implent this one by one on each element of array. another thing in this you know in this method with \ some values will automatically convert to other values like \32 will convert to 2. so is there any solution for this to.

0 Kudos
Message 9 of 13
(2,437 Views)

I would actually avoid the \ Codes display here.  Instead, use the Hex display.  Everything else you seem to be trying is a red herring.  You just need to take you temperature, multiply by 100, set that to a U16, use Flatten To String, and then concatenate build the rest of the command around it.

 

 

And since you are dealing with a hex/binary/raw communication protocol, do make sure the Termination Character is turned OFF.


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
0 Kudos
Message 10 of 13
(2,434 Views)