Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure

5) The labview push button, how does it suppost to work. Is it like a real push button. When you press, the connection from first line to second line occur, When you realeased, the connection The connecton from one line to the next line is open?

 

6) How do you connected Labview push button to the fixture. I have CB-68LP boards. It has digital I/O. I am ouputing, I used p0.0line and the other should be DGND or p.01 for one push button? I am not sure. Could you pls tell me? Is the rule you can not make your test fixture ground the same as the computer digital ground.? Could you pls tell me?

 

Regards,

John

0 Kudos
Message 31 of 63
(1,647 Views)
Q1.
Yes 5112 code will execute as you have understood..
If you select mechanical action of boolean as 'switch when pressed', the event for that boolean will execute both when you switch the boolearn on and when you turn it off.this is not what you desire.
If the Bark switch's mechanical action is configuresd as 'latch when pressed /latch when released' , it will not execute the code when you release the button.you press teh bark, the 5512 code will run once and will not execute again when u release the button.
So select this this latch mechanical action for bark.
 
Q2.
I repeat again, the DAQ mx read uses the ADC timing clock and so it gives out/reads data data accurtely at the rate determined by sampling and number of samples to read .So, you do not have to add a timer.( if sampling rate is 100 samples /sec and number of samples to read is 100, DAQ mx gives out data at the interval every 1 second, and so on)
Go ahead and use a for loop instead of while loop. It will not cause any problems. just specify the number iterations in for loop .That will do.
 
This will take care of your next problem too.
if u keep for loop, you do not have to keep a sub vi for the same.
see attached vi.
 
regards
Dev
 
 
 
 
 
0 Kudos
Message 32 of 63
(1,585 Views)

Hi John,

This link should give you and idea how switches can be configured for different mechanical actions.

http://digital.ni.com/public.nsf/allkb/F069E2D7A745C5DC86256F02007F2C66?OpenDocument

 

You always connect a DIO line with respect to Digital ground(DGND).

Hope this helps.

Regards

Dev

 

0 Kudos
Message 33 of 63
(1,622 Views)

Hi Dev:

 

I tried the program. It worked on my fixture this time, see attached. I deleted the property node part, then it worked. Is that because of the property node?

Why do you set the property node to false? Is it becasue you want to enable push button to go back to the light on state which is fasle? I want to make sure.

Right now, I just delete that part. it work.

Also, sometime i see some stop task and clear task outside the while loop? why? Could you please explain? I don't understand here.

Stop task and clear task are pretty much the same, except the clear will clear the the stuff like the enable event case and go back to the timeout event case in this case until someone hit the buttons. Am I correct? Make the prgram clear before doing doing anything. Am I correct? Would you verify me?

In your program, the stop adn new push button is in between the while loop and the event structure. I know if push button is in event structure, the action will do thing inside the event structure. Why stop is not nessary or why is it need to put in between the loop and the event structure

0 Kudos
Message 34 of 63
(1,608 Views)

Hi John,

Why do you set the property node to false? Is it becasue you want to enable push button to go back to the light on state which is fasle?

Yes, i had previously keep mechanical state of switch as 'switch when pressed', so i was clearing it once the event was executed.

Also, sometime i see some stop task and clear task outside the while loop? why? Could you please explain? I don't understand here.

You always clear a task once you have stopped it. so once you are through with reading inside a while loop, you exit the while loop and then, clear it outside the while loop.
 
Stop task and clear task are pretty much the same, except the clear will clear the the stuff like the enable event case and go back to the timeout event case in this case until someone hit the buttons. Am I correct? Make the prgram clear before doing doing anything. Am I correct? Would you verify me?
 
to be more precise, stop task is used to stop a task,  and return it to the state i was in before the DAQmx start task ran.
 
where as, clear task, will stop the task if it was not previously stopped, and releases any resources that the task had reserved.
 
In your program, the stop adn new push button is in between the while loop and the event structure. I know if push button is in event structure, the action will do thing inside the event structure. Why stop is not nessary or why is it need to put in between the loop and the event structure
 
once you use events, you must define an event for every button, if you do not define an event for that button , then pressing that button will not execute anything.
but it does not matter if that button is inside the case for an other event and a seperate event case is added for that button.pressing such a button will execute a case configured for it.
Hope this answers your query.
Regards
 
Dev
 
 
 
 
 
 
0 Kudos
Message 35 of 63
(1,600 Views)

Hi Dev:

You always clear a task once you have stopped it. so once you are through with reading inside a while loop, you exit the while loop and then, clear it outside the while loop.
 
You said always here. How come I see some prgram like my attached file that has a stop task outside the while loop? I don't understand.
 
to be more precise, stop task is used to stop a task,  and return it to the state i was in before the DAQmx start task ran.
 
I don't understand why the program you gave me in reset event case did not have DAQms start task. Could you pls explain here a little bit.
 
where as, clear task, will stop the task if it was not previously stopped, and releases any resources that the task had reserved.
 
You mean thing like the error message usually after the clear task. Is that correct  about the releases any resources that the task has reserved.
 
In your program, the stop adn new push button is in between the while loop and the event structure. I know if push button is in event structure, the action will do thing inside the event structure. Why stop is not nessary or why is it need to put in between the loop and the event structure
 
once you use events, you must define an event for every button, if you do not define an event for that button , then pressing that button will not execute anything.
but it does not matter if that button is inside the case for an other event and a seperate event case is added for that button.pressing such a button will execute a case configured for it.
 
Did you mean I don't have to care if the button is in between the while loop and event structure? Because it is used for defining the event case. Am I correct? Also the stop button in the program you gave is outside the event structure, it get execute. I don't understand why this stop button put it in this location. Could you pls explain to me?
 
Attached is my program. I tried and I don't know if I set 300. Did it mean it is a 30 second? In this period, I could not press any button until
the iteration is stopped. That is because of the for loop in the event structure, am I correct?
If the operator would like to press another button within 30 seconds because they see the current value is right, is there any way to do?
I need you opinion in this situation right now? Also, I made a property for enable button, see attache. I could tell wire it. Could you pls tell me why?
 
 
Hope this answers your query.
Regards
Download All
0 Kudos
Message 36 of 63
(1,596 Views)

Hi John,

I did not change the Digital DAqmx write commands that you had in reset event in your original VI.

I thought you were using them like that for some purpose of yours.and i only worked on the analog input section

And since it seems like you are using Virtual digital channels that you have created in NI MAX, it will work fine.

Did you mean I don't have to care if the button is in between the while loop and event structure? Because it is used for defining the event case. Am I correct?
Yes
Also the stop button in the program you gave is outside the event structure, it get execute. I don't understand why this stop button put it in this location. Could you pls explain to me?
The stop button has an event case configured for it.
Inside that case , you will see that i pass a true constant that stops the loop.
 
Attached is my program. I tried and I don't know if I set 300. Did it mean it is a 30 second? In this period, I could not press any button until
the iteration is stopped. That is because of the for loop in the event structure, am I correct?
Yes,  as long as teh for loop is eexecuting you cannot press any other button, since program flow control is retained by for loop.
 
If the operator would like to press another button within 30 seconds because they see the current value is right, is there any way to do?
 
No, with this logic, the user has to wait till scanning gets over.
 
I need you opinion in this situation right now? Also, I made a property for enable button, see attache. I could tell wire it. Could you pls tell me why?
Ok, right click on that property node, select 'change to write' and you can wire the constant to it. Also select property as 'value' instead of 'visible'.
 
Hope this answers your doubts
 
Regards
Dev
 
 

 

0 Kudos
Message 37 of 63
(1,592 Views)

Hi Dev:

That is all right if you forgot the DAQmx start. I sometimes fogot too. But I need tu understand my it, otherwise I can not finish the project.      1) How come I see some program like my attached file that has a stop task outside the while loop? Is it OK to put a stop task outside the while loop? If so, how come I don't see any stop task and clear task outside the while loop in the program you gave me?

2) stop task is used to stop a task,  and return it to the state i was in before the DAQmx start task ran. Let say the stop task is very similar to the program you gave me in the enable event structure, as my old program in the timeout event case. Did you mean the stop task is to stop the task and then it will return to the DAQmx start task before the while loop? Is so, why the stop need to do like that? I don't understand. What if the program with stop task is without the DAQmx start, does the program just stop and do nothing there? I want to be sure.

3) clear task, will stop the task if it was not previously stopped, and releases any resources that the task had reserved.You mean thing like the error message usually after the clear task. Is that correct  about the releases any resources that the task has reserved.

4)

 

 

0 Kudos
Message 38 of 63
(1,593 Views)
Hi John,
 
After the end of for loop in continous AI acq i have put a AI clear because, the next time you press enable, the task will be reconfigured and continus acq happens once again.
 
To be more exact,  what i mean is the device i freed from that task, and next iof need be, you can configure new set of  channels and acquire from them. that is what clear task enables you to do.
 
Hope this helps
 
Regards
Dev
0 Kudos
Message 39 of 63
(1,587 Views)
4)  My program is  using Virtual digital channels that you have created in NI MAX, it will work fine.
     What virtual digital channels you are talking in MAX? I am not sure. Are you talking about the channel I configure for line 0 and line 1 in DAQms Assitant or "Enable and reset" task constant. If it is task constant, what kind of constant you are using, it seem your program reset constant did not work. After I delete it and then I used DAQms task name constant, it works.
 
5) If the operator would like to press another button within 30 seconds because they see the current value is right, is there any way to do?

 

    No, with this logic, the user has to wait till scanning gets over
    As far as you the operator operate my fixture manually, they don't need to wait 30 seconds then they press another push buttons but the customer requirement need to wait 20-30 seconds until the current value is below 0.07ma and stable there in DMM for a minimum of 2 seconds. In the real situation, the operator in the manufacturing area see the value going to 0.04ma in DMM and stay there for a minimum of 2 seconds. They pressed another button without 15 seconds. In Labview, there is no other way to do it, am I correct? or there is a way, but I need to go back to the program with main vi and subvi with the reset or stop acquistion button so that it can do it without waiting for 20-30 sec in Labview? It is very fixed in LabVIEW, Is that right? I really need to make about it here.
 
0 Kudos
Message 40 of 63
(1,587 Views)