From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-01-2015 06:42 AM
Hi All,
The more I think I got it close, the far it seems to get away from me. So, this is what I should be able to do. ( Feeling a retard )
1. WRITE ----- Write 5 to 200 bytes of hex code including ascii ESC first byte and lascii CR last byte with 2 bytes lsb checksum ( obtained by adding all the previous byte including 1B ) converted to ascii ( 1B and 0D) . Example for a 5 byte write command - 1B 22 33 44 0D . So, put outgoing data in array and send it out through serial port ?
2. READ --- Incoming Hex Serial Data going to array ( whose length to be determined by checking 0x0D ).
3 .Convert the hex data in arrays to ASCII .
4. Graph the hex data .
Any insights? Any chances of example VI files for reference?
thanks
sasha
06-01-2015 07:06 AM
Show us what you've done, where you are "stuck", and we'll provide help. If we do your homework for you, then you need to provide us your instructor's e-mail address so we can get the appropriate credit for our work.
Bob Schor
06-01-2015 07:07 AM
There is the Simple Serial Write Read example. That should get you started with talking over a serial port with VISA.
It seems like you have an array of bytes that you need to send. You just use the Byte Array To String to convert directly into a string and send it. For reading, there is the String To Byte Array that you can use to start parsing your data.
Show us what you have so far. Be sure to include any sample data you may have and expected results. Things get really confusing when stating ASCII and Hex since people can interpret that in 10 different ways.
06-01-2015 07:50 AM
As hard as it is to say - you are right. It is my college work. All I am able to do is follow example, open ports send ascii commands and receive values in arrays. What I cannot do from that example is break that hex stream into bytes starting with SOH and ending with CR and ignore those common ones and save rest to plot data.
06-01-2015 07:56 AM
06-01-2015 08:07 AM - edited 06-01-2015 08:08 AM
Please don't start a new thread with the same question. Especially when you were already getting help in the other thread.
Continue in that first thread.
06-01-2015 08:13 AM
Yes, I agree. It was stupid to post similar one. Desperateness blindfolds.
@RavensFan wrote:
Please don't start a new thread with the same question. Especially when you were already getting help in the other thread.
Continue in that first thread.
06-01-2015 08:22 AM
I recommend changing to an array of bytes and use Array Subset to just get the data. From there, it is just getting the data that you want.