From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two port serial reading of a numerical value

Solved!
Go to solution

Hi Danil,

 

you have a potential race condition due to uncoordinated read/write access to one ressource...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 32
(922 Views)

How can we avoid such  race condition??Is there any other way to give continuous numerical input in this case?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 12 of 32
(917 Views)

Hi GerdW,

               I somewhat solved the issue by giving a constant value(1) in bytecount of VISA read.But that time we can read only single digit.While giving value 2 to bytecount it works but while stoping the VI it is showing time out error.Please make some comments to solve this issue.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 13 of 32
(906 Views)
Solution
Accepted by topic author danil33

You can check for the bytes available at the port and then you can read the data. Check the attached vi. This will not give you the timeout error as it only executes whenever you recieve any data at your port.

 

 

-----

The best solution is the one you find it by yourself
Message 14 of 32
(902 Views)

Hi Anand,

              Thank you so much.I also solved the issue by doing so in the attached vi.But I think mine is not the correct way.Anyway thankyou.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 15 of 32
(897 Views)

Hi,

     suppose we have another indicator,Can we display another set of values in that indicator?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 16 of 32
(903 Views)

Hi Danil,

 

"Can we display another set of values in that indicator?"

Definitely YES!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 32
(901 Views)

So,how can we give input to the second indicator?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 18 of 32
(899 Views)

Just wire it. 🙂

-----

The best solution is the one you find it by yourself
0 Kudos
Message 19 of 32
(896 Views)

Yes,both of the indicators display the same values.But Iam asking can we display different values( that is while indicator1 showing 34 at that time indicator2 showing 45)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 20 of 32
(894 Views)