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,

 

"can we display different values"

Yes, of course! Just wire different values to those indicators. Doh...

Best regards,
GerdW


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

We have to use another read and write??really?otherwise how it's possible?Please explain it clearly

 

Why you attached "Doh" here??

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 22 of 32
(691 Views)

Hi Danil,

 

I attached "Doh" because you asked obvious questions. As long as you ask obvious questions you will get obvious answers...

 

It seems you want to display different values in two indicators, but still wired the same value to them. At least it seems so as you didn't attach your VI.

One way would be to use shift registers - you asked for "other possibilities"...

 

Best regards,
GerdW


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

I won't yet wired the second indicator.Iam asking whether to use another VISA read and write or there any other possibilities in my attached VI.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 24 of 32
(683 Views)

Hi Danil,

 

- I don't see any second indicator in your VI...

- You also didn't state where your "2nd value" is coming from.

- I gave you other options.

- You could use a 2nd VISARead too.

- It's all possible as LabVIEW is a programming language. You only have to program what you need/want!

- You really should learn to plan your programming needs. First you should define the goal, then you should try to sketch the way to reach the goal and finally you start to program. I only see the first point ("display 2 values in 2 indicators"), but I still miss the "way"...

Best regards,
GerdW


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

Hi,

    I connected a guage as my second indicator.And the connection is as shown in the attached VI.While running in the highlight execution mode we can clearly see the value changing.But while running normally it shows TimeOut error.Please  suggest a better way to avoid this.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 26 of 32
(671 Views)

with some modifications it's working now.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 27 of 32
(661 Views)

Hi danil,

 

your last solution still misses dataflow!

 

Why don't you put those Read/Write-operations in a nice chain connected by their VISA ref and error cluster?

Why do you still open and close those ports in each iteration?

You have race-conditions: a port may be closed before the second read/write operation for that port is called.

 

THINK DATAFLOW!

Go through the basics course as suggested before!

Go through the examples coming with LabVIEW (as suggested before)!

Best regards,
GerdW


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

I tried in this way.But the second one not working.Iearned the basic data flow programming but can't understand where it is violating in my VI.please help.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 29 of 32
(653 Views)

Hi danil,

 

"I tried in this way."

You tried the wrong way. Don't run accesses to a single resource in parallel threads!

 

- You don't need to open a port twice. Do this once before the loop (as often said before).

- You don't need to close a port twice. Do this once after the loop (as said before).

- Obey dataflow, run the read/write functions in a daisy chain with their VISA refs and error clusters (as said before).

 

"can't understand where it is violating in my VI"

You have parallel access to a single resource. This will never work in a good way.

Best regards,
GerdW


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