Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

data sent from dequeue function to measurement file incorrect

Solved!
Go to solution

Hi,

I am running Labview Base 2013 and have a vi that is reading data from an RS232 port and a NI-USB6002 digital port.  I decided to split the loops into consumer/producer using queue functions, but have run into four snags with the data retrieval loop. 

1) The digital pulses are displayed correctly in the USB Signal loop, but the data retrieval loop does not show the RS232 data,

2) The data being combined in the data retrieval loop to the measurement file is writing but is not properly separated into their respective columns, i.e. a column is showing data from either of the loops

3) Stop button is throwing Error 1, incorrect path

4) the actual inches control when wired to the data retrieval loop and into the combine signals for the measurement file causes the vi not to run properly.  It runs but does not display data in the charts from either of the loops and no data is written to the measurement file.

 

I added an indicator in the RS2323 loop and it does display the data correctly on the front panel, but does not display in the chart.

I am able to run this vi without the enqueue functions and just write the data out to two separate measurement files, but this is requires me to sync the data set later on.  Not quite what I need.

 

Image of vi attached.

 

loggingtwosignals.PNG 

 

Thoughts?  Will streaming to TDMS work better to keep the data streams separated?

 

 

0 Kudos
Message 1 of 8
(4,252 Views)

Attached png file

0 Kudos
Message 2 of 8
(4,244 Views)
Solution
Accepted by topic author Onjai

You think you have two queues, but you actually don't.  You named your queues the same name, therefore they are the same queue.  You therefore have race conditions of which dequeue will get which data.  Just remove the string constants for the names and it should work just fine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 8
(4,229 Views)

, You're right.  I removed the name and it works. Thank you.

 

I still have a couple of other issues with the vi. 

 

-When I wire the inches control through the loop and into another input on teh mege signals function for the measurement file, two things happen, the chart does not display data from the RS232 port and no measurement file is created.

 

-stop button does not work properly. 

 

I attach the vi.

 

0 Kudos
Message 4 of 8
(4,205 Views)

You will need to send your updated VI for me to be sure, but it sounds like you are creating a data dependency between your loops.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(4,200 Views)

Version 2 attached. 

Removed queue name and wired the control from the USB loop to the merge signals function of the data retrieval loop. 

0 Kudos
Message 6 of 8
(4,195 Views)

Yep, you created a data dependency between two loops.  This means that your logging loop cannot even start to run until the top loop has completed.  In this case, I would just use a local variable to get the value for the log.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(4,189 Views)
Solution
Accepted by topic author Onjai

Ahhh!  Got it.  I will try that, however, I will be off line for a week or so.  Will follow up then.

Thank you again. 

0 Kudos
Message 8 of 8
(4,187 Views)