From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

serial com with terminal

I am trying to test a serial read and write code using terminal, the problem is that the serial write is working fine but i am not able to read values that are sent from terminal........can anyone help me please i have tried many solutions but could get no where......thank you in advance....
Download All
0 Kudos
Message 1 of 5

Link to picture 4 in other thread.


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.

0 Kudos
Message 2 of 5

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......

Message Edited by samatha.k on 05-12-2009 11:22 PM
0 Kudos
Message 3 of 5

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. 

0 Kudos
Message 4 of 5

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......:)

0 Kudos
Message 5 of 5