LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to read 5th channel using cDAQ 9178 with NI 9219 modules

Dear LabView user,

 

I've made a VI for reading the measurements of a couple of LVDT sensors, a load cell and a couple of strain gauges. When I connect 4 of these sensors to my cDAQ 9178 with using 1 slot of NI 9219, then there is no problem for my VI. But if I use 2 modules, and connect the 2 LVDT sensors and the load cell to the first module, and the 2 strain gauges to the 2nd module, then my program only will show the readings of the first module and the readings of only 1 strain gauge on the 2nd module. I've found that there occurs an error for the 5th channel in the 'zero' state. It says my buffer size is too small... How can I solve this problem? I can't work with finite samples because it is a continious measurement. 

 

I also have the cDAQ 9171 USB module, if I only connect 4 sensors to this module, the sample rate is high (100 Samples/sec), when I use the same configuration, but connect this with the cDAQ 9178, the sample rate is much lower however I use the same NI 9219 module to fill the slots. Is there some kind of setting I need to make when switching over to the cDAQ 9178?

 

I've attached my VI.

 

With kind regards,

 

Pete

Download All
0 Kudos
Message 1 of 22
(4,748 Views)

Please, can somebody help me? It's kinda urgent... 

 

With kind regards,

 

Peter

0 Kudos
Message 2 of 22
(4,658 Views)

Have you tried swapping the modules between the slots and see if you still have the same problem or if it moves?

 

 

I think you may wind up with some execution problems.  You have numerous event structures.  Most of your state machine states have one (or even two) buried in them.  They all seem to be set to lock the front panel until the event completes.  The problem is that if you hit a button and the code is in the correct state to handle that event, you could lock up the front panel and that could prevent you from ever getting to the state that would handle that event.

 

 

PS:  There is no such word as "Configurate".  The word is "Configure"

0 Kudos
Message 3 of 22
(4,643 Views)

Dear RavensFan, 

 

Thank you for your answer.

 

"Have you tried swapping the modules between the slots and see if you still have the same problem or if it moves?"  When I use the cDAQ 9178, I always use the first 2 slots next to the power suply and the usb connection, you mean that I should try for example the 4th and the 5th slot or other slots? I will try this on Monday, and I will let you know.

 

About the states machines inside a state: How is it possible then to use several buttons, like start and stop measurement and the 'home' button inside the state "measurement"? Should I make another simple state machine inside this state? 

 

What about that 5th channel that I'm unable to read? The problem happens in my "zero" state: to acquire my "zero elements", the loop does the job for the 5 channels for the first 8 samples, after that, it doesn't want to sample the 5 channels anymore, it only does for 4 channels... It's something about the buffer size, but I don't know how to fix that.

 

With kind regards,

 

Peter

0 Kudos
Message 4 of 22
(4,561 Views)

I actually meant swap the two channels between themselves.    But certainly try othe open slots as well.

 

Don't put any buttons or event structures in any state besides the wait for event state.  Have every state return to the wait for event state in order to check which buttons have been pressed.  You can have the Wait for measurement go back to event.  You could use a timeout value on that event structure in the "check events state set to 0" and have it go back to the measurement state.  Once the stop button has been pressed, you can change that timeout back to infinite or soemthing else and not have it return to the measurement state after a timeout.

 

The fact it works for 8 samples, then stops, is a definite clue.  I've never had to mess with buffer sizes.  But search the forums and LabVIEW help.  You'll find posts or examples discussing this.

0 Kudos
Message 5 of 22
(4,495 Views)

Dear RavensFan,

 

Oh, yes, i've tried to swap the channels, but it always just reads the first channel in line...

 

About the buttons: Then there should be nothing into my measurement state, except for the tab control? And I should make a start measurement state, and a stop measurement state, is that what ur saying? 

But I don't understand what you mean with those timeouts... Could you give me an example for that? Because a state stays in that position until the state is fully executed right? But in my program, the state is only fully executed when I press that stop button.. So the start measurement state wouldn't be able to go to idle state, I guess... 

What do you mean with "check events state set to 0"? Where can I find this?

 

 

Thank you for your reply,

 

With kind regards,

 

Peter

0 Kudos
Message 6 of 22
(4,477 Views)

Correct, your state will stay in the wait for events state until it is fully executed, which means some event happened.  If you need it to move on to something else without an event, then wire a timeout value into the event structure.

 

If your Measurement state doesn't actually do anything, why do you have it?

 

I think you could get rid of it considering all of your measurements are happening in a parallel loop.  Just have your Start and Stop buttons (in the wait for events state) just change a boolean value that will signal to the second loop when measurement mode is active or not.

0 Kudos
Message 7 of 22
(4,474 Views)

Dear RavensFan,

 

"then wire a timeout value into the event structure" : You mean I should make another event called "timeout" like the default when you make an event structure? [0] timeout? What should I put in that structure then? Some kind of timer or....

 

With kind regards,

 

Peter

0 Kudos
Message 8 of 22
(4,455 Views)

Yes.  You would then have a timeout case.  The only thing that might go in it would be a constant that would tell the state machine to advance to the Measurment case.  The measurement case would come right back to the Wait for Events case.

 

But what are you actually doing in the measurement case considering all of your measurements are occurring in a different loop?

0 Kudos
Message 9 of 22
(4,451 Views)

Dear RavensFan,

 

The thing I do in my measurement case is starting the task, but actually, indeed, the measurement button should only do the tab control, it shouldn't go to a specific state. Then the start measurement button should start the start measurement case and start my measurement, and when I press the stop measurement button, it should start my stop measurement case, This could work out with my timeout event? But I actually don't know how to do this... But I will first try to do adapt my program with those two events and see what happens... 

 

Also I guess I solved the problem for my 5th channel, I adapted the zero state. There was an empty array in it, and I this array larger so 5 elements are showing up. I guess this is working now. I don't know yet actually, because I'm working with a dummy DAQ, tomorrow I can connect my real DAQ system.

 

With kind regards, 

 

Peter

0 Kudos
Message 10 of 22
(4,438 Views)