LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure

Solved!
Go to solution

Hi, I am new to Labview. May i ask is it possible to use "match pattern" inside event structure to detect offset? For example, if the event detect "one", it will go to first event, if detect "two", it will go to second event.. 

 

Your help will very much appreciateD! Thank you.. 

0 Kudos
Message 1 of 8
(3,798 Views)

Hi Yee,

 

what kind of "event" are you talking about?

 

Yes, you could use MatchPattern in an event case to check a string. Did you test it with a simple VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,781 Views)

hii thank you for your reply.. Ya i have tested simple vi, it works well with two matche pattern, but I don't know how to implement in event structure. 

 

I build temperature monitoring project using serial communication. I want use match pattern to differentiate temperature value coming from two different locations, for example, if value 3001, the last two value "01" indicate from location 1 and go to event 1, inside the event it will extract the matched string and show temperature "30" celcius. if value is 2902, "02" indicate it is from location 2 and go to event 2....

 

 

It is a bit confusing for me to explain... hope you can help me! thank you so much!

0 Kudos
Message 3 of 8
(3,773 Views)
Solution
Accepted by topic author yee0722

Hi Yee,

 

do you really need events and an event structure at all?

 

Why not just use a case structure handling your values depending an the received string?

Like this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(3,762 Views)

Hello!

 

There are many ways to solve this kind of "problems".

You could use a case structure insisde the "message received event" or fire dynamic events depending on the signal source.

 

They way you are formulating the problem makes me doubt that you really want the event structure in this case.

 

best regards

0 Kudos
Message 5 of 8
(3,759 Views)

Hii thank you so much! Now I understand and I got it. thanks again. 

0 Kudos
Message 6 of 8
(3,735 Views)

Another question, is it possible to link from one case to another case? For example, if the value obtain in case 3 is 0, then it go to case 1, How should I link it?

0 Kudos
Message 7 of 8
(3,727 Views)

That's a state machine pattern

_____________________________
- Cheers, Ed
0 Kudos
Message 8 of 8
(3,713 Views)