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.
07-23-2015 03:21 AM
Greetings,
I have been working around and couldnt get the result so posting here.
Basically, the real time serial data is stream on floating points for example "22.22,11.11" .
Now I want is to read the first 11 bytes and VISA should generate an interrupt which will then sort the after and before comma values and plot real time graph. And repeat this process. The value is received for every 500ms and everytime it should read the 11 bytes and no blank spaces to be read it must retain its previous value.
I have attached my VI so as to look what mistakes I have done.
Awaiting Reply.
Solved! Go to Solution.
07-23-2015 03:54 AM - edited 07-23-2015 03:55 AM
Hi mech,
what's the point in setting an VISA event?
Now I want is to read the first 11 bytes
Then why do you wire "Bytes At Port", when you want to read 11 bytes?
sort the after and before comma values
Why not use SpreadsheetStringToArray instead of the while loop?
Why do you close the VISA ref after reading just one data set, when you want to receive values each 500ms?
Try something like this:
Note: when you use a TermChar as you have configured at SerialPortInit you should actually use a larger number of bytes to read…
07-24-2015 02:02 PM - edited 07-24-2015 02:06 PM
Thanks for the help GerdW, While i am in learning phase, I am glad i got good guidance.
Bytes At Port was used to determine bytes and cross check it.
Your vi helped alot, but want to clarify few things, what is the block called attached to the indicator "output array "?
Also, can two delimeters be mentioned in spreadsheet string to array?
The string format u used has "point" after the first ampersand what does that mean? Can string format be defined to read specific decimal point like we do " %03.1f " ?
07-24-2015 02:07 PM
07-24-2015 02:15 PM
@curiousmech wrote:
The string format u used has "point" after the first ampersand what does that mean? Can string format be defined to read specific decimal point like we do " %03.1f " ?
The "%.;" sets the decimal point at the decimal seperator. Important for those places where a comma is used. You can set the format string to whatever you want. When in doubt, give it a try and see what happens.