05-12-2009 01:02 AM
05-12-2009 08:45 AM
Link to picture 4 in other thread. http://forums.ni.com/ni/attachments/ni/170/408046/1/Sserial%20com%204.JPG
You have a condition where your code gets blocked due to the improper use of the event structure. You have a second event structure where the value of thespeed or current indicators change, then that case gets run. But since they are indicators, the only place where they get changed is inside that event case themselves.
Also, the value change event doesn't get fired if you write to a terminal, local variable, or Value property node of a control or indicator. It only gets fired if you write to the Value (signalling) property node or the user changes the value on the front screen. Generally, the event structure is used to handle user events such as changing a control, so it doesn't make much sense in most cases to have an event based on an indicator.
I'm not sure why you are using an event structure in either loop. The event structure in the first loop incorporates a bad programming practice. You have an event based on a control that has no name. By looking at the code, I can't tell what control would fire the value change event since the name of the control is empty.
05-12-2009 11:17 PM - edited 05-12-2009 11:22 PM
Hi thank you for the reply ravens fan, yes you are correct it doesnt make any sense to have an event based on indicator that was just a trial i did not see that
when i am posting the question and also i know that I am not handling the event correctly I am out of ideas to do so and also in the write case the control is the
boolean control connected to the case selector it is RUN/STOP button when i press RUN/STOP button it should write 1 and 2 to the terminal respectively
write part is ok but i am not able to read the values coming from the terminal can you suggest me anything...........thank you in advance......
05-12-2009 11:25 PM
What did you do to change your code? You should not have that second event. The way you had it, when the stop in in the first structure is processed, you lose the VISA reference because you did not wire it through.
Write your code with a single event structure. You can have a write event and a read event.
p.s. I'm not sure why you are so convinced that the write part is ok. What evidence do you have for that? Just because you don't have an error does not mean that what you are writing is correct.
05-12-2009 11:32 PM
ok....i will try that thank you for the reply i am just novice so.......anyways i am not convinced that write part is ok 🙂 i was just guessing anyways thank you for
the suggestion Mr Dennis......:)