Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Serial Reading

I've been trying to implement a fast VISA Serial Read function and ran into some issues. I decided to ask for help.

The structure is as shown in the .vi attached VISA configure, read in the while loop and close.

The transmission protocol is
4800 baud
8 bit data
No Parity
One stop bit

The data stream is formatted as follows:
Data is sent as MSB first with LSB last. The decimal point is assumed 4 places to the left of the LSB.
I am redaing the position from a two axis (coordinates) instrument as follows :

X :3.4528 LF CR
Y: 4.3476 LF CR
X: 3.4528 LF CR
Y: 4.3476 LF CR

The data is sent in the continuous mode. The "axes" is used for data identification.
The string functions are used to convert the string from the read
function into a DBL number.The problem is that I cannot utilize the whole speed of the instrument data, an update of 26-30 (X,Y) coordinates sets readings per second. The major problem is that from each port I read a set of x,y coordinates and there is no sunchronization of the message frames between the two ports. Instead of reading approximately 25 characters for all the coordinates ( 4 coordinates, x1,y1,x2,y2), I only read about 5-6 coordinates as I slow down the loop to read every 200ms. If I don't slow down the loop,coordinates are repeated and there are no more than 5 updates per second.
Please advise on this issue.

Thanks a lot,
Erol Nikocevic

Electrical Engineer
Electromech Technologies. # 316 941 0482.
0 Kudos
Message 1 of 3
(3,908 Views)
Your file I/O maybe throttling you.

Comment it out and see how the speed is.

You could also put the two ports in seperate loops so one does not slow down the other.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(3,908 Views)
Thanks a lot for the response. My overall program is a lot more complicated. I am reading four positions, commanding with them for PID-interpolated load loops, reading in 16 analog inputs, commanding 8 line digital port, reading four timers for the travel time of the actuators,4 temperatures , logging all of this with format into file.I have to do all of this in the same loop, since, I have to see how well the actuators track in all of their parameters. I was trying to separate them in different loops and pass the information with local variables.The speed of the locals is not too good. In a separate loop, I am running an algorithmic State Machine to run the lifecycle tests.In addition I have a RS485 Read and a CAN Read in separate programs runnin
g simultaneosly. However when I test the speed of the VISA Serial RS232, I am not using the CAN and RS485. Just the first loop(with a lot of things going on there though). I was trying to see if there is a way to organize-synchronize the RS232 position coordinates and get the more readings per second. I cannot. I don't know if it is possible at all.
0 Kudos
Message 3 of 3
(3,908 Views)