LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ignore certain values that are driving a Case Structure

Solved!
Go to solution

Hey everybody,

 

I've got another somewhat simple question. I have a case structure that is being driven by values from a custom controller. I asked a question about it previously which was resolved quite well. Here's the link, for reference.

 

I've recently run into a bit of a problem. I get the numbers I need, but the machine continues to send values after a few seconds. What I'm basically looking to do is ignore the two "status" values it sends. Is there a way to make it so if LabVIEW sees these two values it goes back to the last defined case?

 

Thanks!

_____________________________

0 Kudos
Message 1 of 13
(3,917 Views)

You are going to have to give us more information. What format is the numbers in? How is the number processed? What does your current program look like?

 

Can you post your code with some number examples of what you need to process verses what you want to skip?

Tim
GHSP
0 Kudos
Message 2 of 13
(3,912 Views)

You've registered for a User Event.  And you've generated the User Event.  But both of those are kind of pointless considering you did put an event case in your event structure to handle the User Event.

0 Kudos
Message 3 of 13
(3,906 Views)

So the numbers come out as an array. I turned the array into a cluster and unbundled it. The first value in the cluster is what's driving the case structure. It's an unsigned 8-bit integer.

 

The two numbers I'm looking to ignore are 201 and 85.

 

Here's an updated screen shot of my code:

wide_code.PNG

 

And Raven's Fan,

I inherited this code from someone who almost exclusively uses .NET and have little to no idea how to work around the Event Structure that he already has written.

_____________________________

0 Kudos
Message 4 of 13
(3,902 Views)

@Ravens Fan wrote:

You've registered for a User Event.  And you've generated the User Event.  But both of those are kind of pointless considering you did put an event case in your event structure to handle the User Event.



Please ignore that post.  It was in reply to a different message.

0 Kudos
Message 5 of 13
(3,900 Views)

*phew* That helps a bit. You had me really confused for a minute there.

_____________________________

0 Kudos
Message 6 of 13
(3,896 Views)

In your code there is not much going on so when you say that you want to ignore them what do you mean? I do not have your code so it is hard to understand what you are looking for and what you want to happen.

Tim
GHSP
0 Kudos
Message 7 of 13
(3,891 Views)

If you put case number 201 and 85 in the same frame of the case structure then add no code to that frame then you would effectively be skipping that transmission. In the other cases you add the code for what you need the system to do.

Tim
GHSP
Message 8 of 13
(3,887 Views)

Sorry that I wasn't being specific enough. That always seems to be my shortcoming when I post on here. 😕

 

I ended up fixing it.  Right now I just have an indicator to test if my method worked, but eventually the data that comes out will go back to driving a case structure that performs a task.

 

I used a local variable that's being written to when values are changing and read from when either of my "ignore" values show up. So far it has worked pretty well. Here's a screen shot of both cases.

 

wide_solution.PNG

_____________________________

0 Kudos
Message 9 of 13
(3,868 Views)

Wire the integer wire directly to the Case Selector of the case structure.  Now instead of True and False, you can work with numbers.

 

For the True case, type 85, 201 in the case title.  In the False case, type Default.

 

Now you don't need the comparisons, the Or function, or the separate integer constants.

Message 10 of 13
(3,855 Views)