11-25-2005 03:32 AM
Hi Dev:
The program doesn't again. I tried to make the button to switch when pressed. You said at the end of the event structure, put a property node.I don't know. I made one in my attachment, could you please help me to fix it?
The reset channel that you mentioned last time. I have two more push buttons needed to add to the event structure. One is Bark and another one is test. I don't care which push buttons I pressed, the reset is needed to reset the fixture at every single state of the push buttons. The enable needed to stay, once reset is pressed, every things is reset. Not like I pressed the enable and I need to press reset, I may press bark. Do you have any suggestions
11-25-2005 03:42 AM
11-25-2005 04:13 AM
Hi,
You can add any more butons and events with add event case.
it will support any more event you want to add.
Here, you can add anther Reset button also.
I have modified the VI once again, included property nodes for setting boolean logics, hope this will suit your purpose, have a look
and this other VI, dev1.vi (NI scope vi) which is for acquiring from your 5112, where do you want it to be executed?
Regards
Dev
11-25-2005 06:37 AM
hi Dev:
Thanks! But I found I still need to hit "stop acq" button to stop acq.
In normal opeartion, see my attacted graph. The opearator is doing the following steps.
1) Press "Reset" button
2) Press "Enable" button
3) Press "Bark" button
4) Press "Test" Button
He does not need to press "stop acq."one more button. In Labview, can Labview make it simply like the real opeartion or it need to do it this way. Also, I also need to make a green light and red light to indicate the opeator the current is pass or test is pass. Do you think I can put this light into the enable event structure case in your to do it. if so, can you please suggest me how to do it?
I have the ni5112 program in my "DEV.vi" because I want to press the bark button and then show the waveform. That is why I have this program. Do you think I put it in the right place, I put it above the event structure.
11-25-2005 11:24 PM
11-26-2005 02:13 AM
Hi Dev:
11-27-2005 11:32 PM
Hi,
Q1.
When nothing is connected to a terminal, it takes its default value as input, so event case's timeout is -1 by default, so you need to wire a value if it is other than -1. Also read how event structures work form the Labview help.
The default is –1, indicating never to timeout, or VI keeps waiting fo an event to occur.
this link should give you an idea how to use events.
http://zone.ni.com/reference/en-XX/help/lv/71/lvhelp/CaveatsRecmndtnsEvnts/
Each time you press bark button, your 5112 code will execute once( because your code is for finite acquisition) and display the values/graph.You have understood it right.
11-27-2005 11:34 PM
11-28-2005 05:13 AM
Hi Dev:
Q1.
Each time you press bark button, your 5112 code will execute once( because your code is for finite acquisition) and display the values/graph.You have understood it right.
You said my code is for finite acquistion. my 5112 code will execute once in "bar" event case. It will go to timeout event case and then you hit "barK" push button again to turn the light on, it will execute the 5112 code again. Am my understanding correct here?
Also, I need to tell you the real situation of my test fixture work. The :"barK" push button will display the vaulue/graph when I hit the real "bark" push button on the fixture. When I press "bark" pushbutton, it will generate the graph. When I release the button, it will not do anything. Then when I hit "bark" again, it won't do anything.. That is how it is.
You mentioned the 5112 code will execute once when I press "bark" each time. What happened when I release "bark" in Labview, what will happened, will it hang the program because my program is connected to my hardware (test fixture). It is supposed to work like a normal operation with connecting computer, right? How can I fix this problem in my code?
Q2
This i suggested if you want to do away/remove the stop button in one acq.vi.
In other words, if you do not want the user to stop continous acquisition by using a button, you can stop this automatically by using a seconds count.
Can I use the for loop in this case and add a timer instead of while loop is this case?
Why is always reading something in another window, do you think you can read the same thing in the same interface in main.vi or there is no other way? I would like to be sure.
11-28-2005 05:15 AM
Q3.
Your old program used to be a finite acquisition, working like this: configure channels -> start acq, ->acquire for 1/0 sec,->stop, then do all these things again from first step, on each iteration of while loop.
Where a, my one acq Vi is an example of continous acquisition.Once you configure, you keep acqiuiring at regular intervals in every iteration of while loop.
Finite acq acquires a predetermined number of samples using hardware timing, and stops.
Whereas, continous keeps acquiring a preset count of samples at equal intervals using hardware timing, till you give a stop command or set a condition to stop the acquisition.
I read the tutourial. The difference is the number of point that acquire the samples. One is finite acq. Another is continous one. In my old program, I can see it right now, I don't have the while loop, the while loop is outside the event struture. So, did you mean since the finite acq. without while loop acquire a predetermined number of samples without continous keeps acquiring a preset count of samples at equal intervals then it will stop when you press another buttons? If yes, That is why it need to take time before DAQmx read. Am I correct? If I put a while loop in my old program like your need file, would that idea work?
Q4.
I tried it and reset and enable buttons do work.
This i was able to determine this since the respective cases do get executed.
I have attached same Vi, with a dialog box popping up when ever u press enable and reset, and this will give you a confirmation that these buttons have worked.
I would like to try this to see what happen first.