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.
sounds like state machine![]()
Use event structure
@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?
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.
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
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 ![]()
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
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?