10-15-2013 01:29 AM
Hi all,
Is it possible to use loop like switch case in C. Suppose one of my process generate numbers, like 1,2 ,3 4 n all, so if it generates 2 I want to perform task mentioned in event 3, if 2 then it should perform task mentioned in event 2. Please help me in this issue
Solved! Go to Solution.
10-15-2013 01:31 AM
sounds like state machine
10-15-2013 01:32 AM
Use event structure
10-15-2013 01:33 AM
@Omi_30 wrote:
Hi all,
Is it possible to use loop like switch case in C. Suppose one of my process generate numbers, like 1,2 ,3 4 n all, so if it generates 2 I want to perform task mentioned in event 3, if 2 then it should perform task mentioned in event 2. Please help me in this issue
2 - 2
3 - 3
Do you want for 2 for 2 and 3 for 3?
10-15-2013 01:35 AM
Thanks for the reply.
But in event structure it is accepting with Button only. When tried with Button (Value Change), the proper event gets called, but when tried with Integer generated by process, then it is not working, Can you get some example.
10-15-2013 01:37 AM
If one simple addition in previous step generate 2, then Event structure should execute task in Event 2..like this so on..so not getting how to handle the Event source as this generated integer
10-15-2013 01:40 AM
like in C , if input to Switch case is Integer 2, the Case :2 will get executed.So same thing I want to do in LV.
But dont know how to use this integer as Event source in event structure. Did succefully event structure with buttons normal as taking Value change.
I am new to LV
10-15-2013 01:52 AM
Here
10-15-2013 01:54 AM
Learn State machine.
You can trigger events for numeric values also usind Value ( signaling ) property but state machine will be better.
Make a decision in 1 state and based on the value switch to other states
10-15-2013 03:04 AM
Thanks a lot for the solution. Also is it possible to automate button pressing, suppose I am having one button but insted of user pressing that,can I controll the Button inside, using one Boolean?