03-25-2014 08:49 AM - edited 03-25-2014 08:50 AM
@Ranjeet_Singh wrote:
Ok.
But my ring control is not connected to any case selecter. Can you please name it.
I have plenty of models and user can select any of it. thats why ring control
You are correct. I misread the diagram and thought the model control was selecting the case structure, just because it wasn't going anywhere else.
So now my question is why is that control there if it is not being used?
03-25-2014 11:42 AM
I would still recommend adapting the VI to a standard template. Why re-invent the wheel? All these question we have to ask have already been cosnidered in the construction of the templates. That's why we have them.
03-26-2014 12:16 AM - edited 03-26-2014 12:17 AM
A
@RavensFan wrote:
You are correct. I misread the diagram and thought the model control was selecting the case structure, just because it wasn't going anywhere else.
So now my question is why is that control there if it is not being used?
Each model has 2 other data which needs to appear to user. When user changes the model then he also needs to view this 2 data. hence this control will select these data using property node of model.
I havent shown that here..
Sorry for the confusion
03-26-2014 12:18 AM - edited 03-26-2014 12:18 AM
@billko wrote:
I would still recommend adapting the VI to a standard template. Why re-invent the wheel? All these question we have to ask have already been cosnidered in the construction of the templates. That's why we have them.
Thanks for the concern, what you suggest? What is standard template
03-26-2014 12:45 AM - edited 03-26-2014 12:47 AM
@Thoric wrote:
You have a race condition on your "range" indicator. You set in a case structure that runs parallel to your "database write" case structure. Therefore, you're probably writing the data for the following iteration of the while loop, and thus I expect you're hitting a rare case when the serial read data fails the string length tests, but you're still attempting to write it to the database.
To solve this, ensure you have syncronicity between the data qualification code and the database access code.
You also ought to properly follow all error wires through to capture error scenarios. This will help you understand why you're experiencing issues. To assist with this, use shift registers on your while loop to properly contain error and reference data, and exit on error (or handle as required).
The problem with range is I cannt wire it becasue I need to link this two data which can appear anytime with no proper sequence. In my app, I need to link serial number with weight and first I need to read weight then wait for serial number.
Once I read weight then during wating for serial number another weight data also may appear and if that is withing range then I need to discard the previous read weight.
what code I have written, I think that is independent and sequencial becasue,
1. If range is true then I am waiting for serial number and once serial no data appears then I am writing to DB and making range as FALSE.
2. If serial number appears first then it will not write to DB.
I hope I haven't missed any other condition.
03-26-2014 03:58 AM - edited 03-26-2014 04:07 AM
@Ranjeet_Singh wrote:
@billko wrote:
I would still recommend adapting the VI to a standard template. Why re-invent the wheel? All these question we have to ask have already been cosnidered in the construction of the templates. That's why we have them.
Thanks for the concern, what you suggest? What is standard template
My suggestions on standard templates all appeared on the first page. That's why I said "still."
Seems to me you could have two producer loops, one for each serial read, each to be dequeued in one consumer loop. Your whole DB stuff would be condensed into a subVI (inside the consumer loop) with inputs for range and serial number. The subVI wouldn't execute until both inputs were satisfied so you could avoid the "case within a case" scenario.
03-26-2014 04:48 AM
I am not good with producer consumer VI. I never worked with it. Ok I will implement and will check..
Do you think there is any problem with my VI..
Can you please share any examlple having producer cosumer?
03-26-2014 05:59 AM
03-26-2014 06:28 AM
I used one iteration indicator for while loop.
What I found my while loop stop after some time my application remains idle.
Once I scan my serial number then my application resumes..
Why and when it happes I have no idea, I tried to give all possible cases but it hangs
03-26-2014 06:34 AM - edited 03-26-2014 06:40 AM
I need to read data from 2 different serial port and need to corelate.
Using producer consumer also I will be using two while loop and 2-3 case structure (for validating data) which will corelate the data. In my existing application I am using one while loop and linking datas.
What difference it will make?(Just asking)