Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

interpreter??

Good evening,

Below you can see my Joint SubVI. In output for My Principal Programm I received a number of Bytes (VISA refnum in) that I try to filter to interpret. I get usually 16 Bytes that I'm trying to split into 4 packages of 4 bytes each for better interpretation. in my Stacked Sequence structure I'm trying to interpret each packet (1-4) one after another and display the results in the Table control bytes on one side and the interpretation in the column that follows.But I cannot set this part of Programm.

That's how I'd interpret each Package: Example first Package A010060A (String).


if (String.1erByte == A0)
    report: "Command"

else if (A1 == String.1erByte)
    report: "Message"

else
   report: "unknown"

After that it checks the 2nd Byte.

 

if (String.2erByte == 10)
    report: "RX Setting"

else if (String.2erByte == 20)
    report: "Setting Keyc_ID"

else if (String.2erByte == 11)
   report: "Stat_LED"

else if (String.2erByte == 21)
    report: "Stat_Coil"

else
   report: "unknown"

After that they control the 3rd Byte and 4th Byte  with the same procedure and displays the results in Table Control. then passes to the 2nd pack of 4 byte to do the same thing. I hope I was clear on my Problem and that somebody may have a solution. Joined SubVI it with the values that I get by default.

I am sorry for the mistakes because I am beginner in English.

Thank you in advance for your solutions

cordially

Gisele

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

You might want to use the String to Byte Array to work on the individual bytes.  Your case structure can have many cases if you wire the byte to the selector tunnel.

 

Attached is a snippet.  Save it to your hard drive and then drag it onto a blank VI and you will magically have code.



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 2 of 2
(3,110 Views)