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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help logging from 2 loops

My RS232 signal and analog signals are causing my data acquisition program to display data incorrectly.

 

The program works best with 2 loops.  If I don' t have 2 loops the data doesn't update on my screen instantly.

 

I need a way to log the data from both loops.

 

suggestions?

 

 

see attached.

 

thanks

Darren

Download All
0 Kudos
Message 1 of 5
(2,227 Views)

First, you should consider using subVIs as well as making your block diagram smaller. The general rule of thumb is to keep the block diagram to a single screen size. With today's monitors that is still a good size for the block diagram. It is too difficult to see what is going on when you have to scroll all over the place.

 

As to your specific question I would suggest you create a third loop which gets data from a queue. All of your other processes you want to log data would enqueue the data to be logged. The logging process would simply dequeue the requests and write them to the file.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 5
(2,212 Views)

Neat idea.  Are there any examples available where I could see that ? 

0 Kudos
Message 3 of 5
(2,195 Views)

There are several examples of how to use queues that ship with LabVIEW. Have you looked at those examples?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 5
(2,187 Views)

In your "ReadSerialBuffer.vi" you should first read the amount of bytes available.

 

If there aren't any available chars your program will always be waiting at this point.   See the example VISA_RX.vi-attached.

 

I also advice to use some event case... You could have both loops run one after another in a case structure.  I have attached a serial Port test program I found over here which I like for it's nice structure. 

 

Succes!

 

X.

Download All
0 Kudos
Message 5 of 5
(2,186 Views)