LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Channel wire does not pass values

Hi guys,

 

I am measuring two edge separation of two signals and main goal is to achieve those delays and analyze them in postprocess. However, next requirement is to make "real-time" update during measurement, so user can see, how measurement is going for example every 1 second. So I used parallel loop and I am sending data through channel wire. Nothing goes through this channel. I do not know why and cannot find the problem here.

 

two edge separation.jpgCounter.png

 

Thank you in advance for any input.

 

Martin

0 Kudos
Message 1 of 11
(4,073 Views)

Since you didn't post your code, just a chopped-in-half picture, there is some guesswork involved: You're stopping the bottom ("consumer")  loop after first iteration. Try changing that and see if that help. If not, please provide a broader view of your application architecture.

Message 2 of 11
(4,047 Views)

In addition to fixing the consumer loop exit...

 

Your partial code makes little sense.  Honestly, I would think you would have written a single element of a 1D double array rather than multiple scalars of the 1D array..  

 

Your timing in the producer is a problem.  DO NOT assume that the while loop iteration is 100mSec! You are not on a RTOS so, put the tick count output on a SR and do the math to exit on time.  Also, what is with that 1 second wait in parallel to the while loop?  Is it just there to aggravate the User or, did you have a requirement to force the user to break the mice by pounding them on the desk in frustration?

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 11
(4,000 Views)

Never send pictures of incomplete views of part of a VI (or a single picture of the entire Block Diagram that covers multiple windows, i.e. is Too Huge To View).

 

For best results, always attach a VI.  If you have lots of sub-VIs that we also need to see, and (especially) if you are using LabVIEW Project, compress the (project) folder and attach the resulting Zip files.

 

Not only will we thank (rather than grumble at) you, we won't have to "guess" and waste your and our time.

 

Bob Schor

0 Kudos
Message 4 of 11
(3,976 Views)

Thanks for feedback. The ting was, I did not think you need more code, since channel wire should be able to skip all and basicaly there is not even more. I do not think other cases help you to find the problem.

 

The delay is there in most cases just to have time to show user the current status, since I am sending every case Update Display.

 

Martin

0 Kudos
Message 5 of 11
(3,943 Views)

Can you please explain me that tick count (my bad exectation of lopp time 100msec) and what SR shorcut means? Signal reference?

 

Thanks for showing me my flies.

 

Martin

0 Kudos
Message 6 of 11
(3,939 Views)

I'm a little confused by your DAQmx code, but have some suggestions.  I also would suggest that you do not use Write Multiple Stream, giving it an array of Dbls, but Write Stream, giving it an array of Dbls.  The former writes one element at a time, the latter writes the entire array as a "chunk".

 

I recommend that you have one Shift Register for each DAQmx Task, and keep them separated.  By my count, you have three Motor Write Tasks (one Analog single sample, and two Boolean, single sample).  You do not need to keep the Error Wires separated, just use Merge Errors.  There's a DAQmx Counter, a DAQmx Pulse Width, I'm not sure if this is one Task or two.  I recommend (if for no other reason than it makes the code "predictable") that where you have N Samples, you wire the number of samples into the Read/Write command instead of leaving it as -1, which means different things depending on whether you are using Continuous or Finite samples (in particular, I dislike the Continuous -1 case which gives you "whatever happens to be in the buffer at the time").

 

Where do you see "SR Shortcut"?  Have you looked at the Help for that function?

 

Bob Schor

0 Kudos
Message 7 of 11
(3,920 Views)

SR. Is my poor choice of words to refer to a Shift Register.  Sorry for the confusion.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(3,909 Views)

Thank you Bob,

 

I will try to change that, but now, most importat part is to have channel wire functional. The other things are more about "code structure". Do you have idea why it does not work now? Could it be that I am using Multiple write instead of single write? What exactly is the difference of this setting when I am sending Array with DBLs?

 

Martin

0 Kudos
Message 9 of 11
(3,900 Views)

@mzema wrote:

Thank you Bob,

 

I will try to change that, but now, most importat part is to have channel wire functional. The other things are more about "code structure". Do you have idea why it does not work now? Could it be that I am using Multiple write instead of single write? What exactly is the difference of this setting when I am sending Array with DBLs?

 

Martin


I think May@V already answered the initial problem.  Those bottom (read) loops will only iterate once, with either one data set or timeout.

Message 10 of 11
(3,888 Views)