LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Right way to do software trigger?

I have been doing a program for electronics dropping tester. I am using one drop table sensor and one sensor attached to circuit board. I am dividing all 250kS/s rate two these two sensors. Also when I am using high speed resistance measuring in test I am also dividing the sample rate for those. I am using PCI-6225 card where is not hardware trigger channel so I need to do it with software trigging.

 

The trigger starts when the drop table hits the ground and it's undergo the acceleration which is measured from drop table sensor.

 

The problem is that the program somehow goes to loop or something in measurement. It remains measuring and doesnt end the measuring. It doesnt do that all the time but sometimes. I have tried to find out that does it go some repeating loop but it doesnt. So is that my triggering done so bad way that this whole Labview language jams ?

 

If someone can watch my code and say how it should be done? I have attached some of my code in this post. In the code the measuring structure part is framed with red frame. I know that this my code is badly done because I havent used so many subVIs like it should be done. This is my first Labview code what I have been doing. The layout is also too big because few subVIs but it fits somehow to two monitors.

 

Thanks a lot for reading this!

-Toni

Download All
0 Kudos
Message 1 of 5
(3,666 Views)

Toni,

 

looking into your code i must confess that i am jealous because of your gigantic monitor. In other words: Please try to make block diagrams (and front panels) smaller! (should not exceed 1024x768 by much, and if, only let it scroll into one direction).

 

That being said and taking into account your description of the issue, it seems to me that your first Trigger and Gate.vi (i am not sure why you opened this one leaving the second a default Express VI) returns no triggers. Have you taken a look into the signal which is read by DAQmx? Are you sure that the parameters of Trigger and Gate are set to detect all "trigger events"?

 

hope this helps,

Norbert

 

PS: You documentation seems quite ok for a short peak view. But you should try to incorporate some more programming style guides.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(3,659 Views)

Thanks a lot for answer!

 

The first trigger (Trigger and Gate.vi) is for rising half sine impulse and the second default Express VI is for falling half sine impulse. So the trigger usually starts from 20G level and ends at 0G level. That way I can get that impulse which the dropping table undergoes. But that Express VI is not needed for Circuit Sensor because that signal needs to be longer than the impulse from Dropping table Sensor. Actually the dropping table impulse is around 0.5ms and the circuit sensor impulse needs to be 1 second. Actually that might be the reason for jamming and sometimes given some odd signals. It should change that case loop to off when there is no data available in the second trigger even there is in the first trigger.

 

If someone could tell me that are those DaQmx Create Task--> DaQmx Create Channel (AI Voltage)-> Timing-> Start Task-> Read-> Clear Task -chain with the different loops done okay ?

 

I should read programming styles guides. It was just somehow so hard to do those SubVIs because I have been using too many local variables and so on.

 

-Toni

0 Kudos
Message 3 of 5
(3,649 Views)

 


@To_ne wrote:
[...] If someone could tell me that are those DaQmx Create Task--> DaQmx Create Channel (AI Voltage)-> Timing-> Start Task-> Read-> Clear Task -chain with the different loops done okay ?[...]

-Toni


 

If you need all those channels, the chain on itself is ok.... even though you can remove the flat sequence structure without any changes done to the functionality of the code.

I suggest you to collect all On/Off settings into a boolean array and then pass it to a subVI. In this subvi you can do something like this:

24310iCFB394FF3705B78B

 

This will enable you to decrease block diagram size in a quite decent (read: scalable) way.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(3,636 Views)

Thanks.. I will do that. I don't know why did I even leave that flat sequence structure. At the beginning it looked more clear to do way like that.

 

But that For Loop would be much better! Thanks.

 

I have changed my code so many times that's why it kind of gone out of my hands.

0 Kudos
Message 5 of 5
(3,590 Views)