LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible indixing a condition structure?

Hello,
For saving my data automatically, I have to indix a condition structure. When it recives the premier true signal, I need to number "1", second true signal, number "2".... ect. Is it possible? How?
Thanx
0 Kudos
Message 1 of 14
(3,126 Views)


Hello,

If I understood your query correctly, you want to execute the right case-structure depending on which true signal you have -- 2nd would execute the 2nd case, 3rd true signal would execute 3rd case, etc., right?

If this is the case, you basically have to keep a count of your true signals. And one way of doing this is to use while-loop and an uninitialized shift-register. Everytime you get a true signal, you would increment the count in the shift-register. Set the while-loop condition so that it executes only once each time. And you do not want to initialize the shift-register because you don't want to zero out the count each time. And your case structure would also be inside this while-loop.

Hope this makes sense.. and helps. Let me kn
ow if you need more clarification.. or if I missed your point.

Regards,

Khalid


0 Kudos
Message 2 of 14
(3,125 Views)
I�m going to assume you mean you want to index a Case Structure since there is no Condition structure in LabVIEW.

If that�s the case, take a look at the attached VI. I think it does what you want. You have a shift register containing the count of what Case to run and increment it each time you get your True value, you can index through a Case Structure. The attached VI has two Case Structures to prevent the indexing structure from running on each iteration. This outer structure is controlled by the True/False you are watching with nothing in the False case except to pass the count through. The True case contains the indexing structure and will only run when your value is True.

The 500ms Wait is just so you can see what is going on.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 14
(3,125 Views)
hi Khalid,
Thanks for your response. But my query is not exactly controling the true signals.
I have a true signal which apear a ccoreding of my machins starting. I have controled the save of recived data by a condition structure accoreding to the true signale.
My query is to save automatically the data in a different file each starting. Therfor, I should need to index the condition structur's excution and I could change automatically the files name.
So I need to number "1" in premier execution and I would be able to name the premir file "CAST1" with a for loop.
In second execution "starting the machin" I need to number "2" for being able to change the file name for "CST2"

Sorry for my inglish,
Best regards,
0 Kudos
Message 4 of 14
(3,125 Views)
Hi Ed Dickens,

Thanks for your response, You have assumed very good my query. But I can not open the attached document, I'm using LABVIEW 6.1. With which version, Can I open it?

Regards
0 Kudos
Message 5 of 14
(3,125 Views)
check this out. The inner case was removed to simplify the code.

-Joe
Download All
0 Kudos
Message 6 of 14
(3,125 Views)
But removing the inner case doesn't let him do different operations each time he gets a new "True" value, which I think is what he wants. That was intention of the inner case.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 7 of 14
(3,125 Views)
Here's the same thing in version 6.1

It's usually a good idea to state what version of LabVIEW you are using to avoid things like this.

Good luck and let us know if this is what you want.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 8 of 14
(3,125 Views)
Hello Ed,

Thank you for the "vi", It is good and adaptable on my developed vi.
During the execution of my vi,i have the true signal for a period of time each sycle, this period is not constant. When I wire "Ok" of your vi, it start to open sevral file for the same sycle. but i want a file for each sycle.
Thi period is not the same from a cycle to another, So i can not use this time to make a comparative loop making a flash true signal.
How I can make a falsh true signal for wiring with "ok" in your vi? This flash true signal must corespond a rise in temerature in a chanel "for example".

Regards,
0 Kudos
Message 9 of 14
(3,125 Views)
If I understand what you are saying, it sounds like you need to run the True signal through a trigger detector. this will only generate a momentary True signal when the monitored signal first goes True.

The attached VI might do what you need. Give it try.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 10 of 14
(3,125 Views)