06-20-2012 07:58 AM
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!
Solved! Go to Solution.
06-20-2012 08:04 AM
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?
06-20-2012 08:44 AM
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.
06-20-2012 08:56 AM
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:
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.
06-20-2012 08:59 AM - edited 06-20-2012 09:01 AM
@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.
06-20-2012 09:00 AM
*phew* That helps a bit. You had me really confused for a minute there.
06-20-2012 09:10 AM
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.
06-20-2012 09:15 AM
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.
06-20-2012 02:07 PM
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.
06-20-2012 07:57 PM
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.