LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write table to serial port

I have been trying for a while now to simulate an instrument communicating via the serial port. For this, my program should write into the serial port a row of data coming from a .csv file every 10 seconds or so. The problem I'm having is that so far I have managed to either write only one row or the whole table into COM1. I know this might be a very simple issue (error) to solve, but I'm just starting to learn LV and I'm not sure how the different structures work. I include the program I'm working on.
 
Thanks for any help
0 Kudos
Message 1 of 4
(2,570 Views)
Try this. It takes the lines read and creates a 1D array of strings. You can then put the VISA Write inside a for loop. Wiring an array through a for loop will auto-index the array so one line at a time will be written. I'm assuming here that you want the entire line written, including the commas.
Message 2 of 4
(2,561 Views)
Correct assumption Dennis, I have another program that deals with that part.
Your help is very much appreciated, that is exactly what i was trying to do. Very helpful indeed.
0 Kudos
Message 3 of 4
(2,551 Views)

Back again, this time with the read.

Is there a way to keep the COM2 open (used to read the data)  so it doesn't closes after the first line?

Im trying to read a sample file of 44 lines, eventually it should keep reading until the machine sending the data is stopped.

I'm attaching the data and VI I have come up with so you can get a better idea of what I mean...

Thanks

Message Edited by Eduardo231064 on 11-11-2005 08:49 AM

...forgot data...

Message Edited by Eduardo231064 on 11-11-2005 08:51 AM

0 Kudos
Message 4 of 4
(2,535 Views)