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: 

how to read and write simulataneously

hello everyone,

I have a task to make write functions which will be use if user give command from front panel.now someone already wrote read functions and it will go on during execution.so how can i interface my program with ongoing programs.

0 Kudos
Message 1 of 14
(3,494 Views)
Is the read function based on some button click (= FP command), or is it a free-running read till the program (VI) is stopped? I assume the VI is based on While loop with a Stop button. If yes, then you need to just place a Case Structure inside the same While loop with its selector terminal connected to the Write button you are going to place on the FP. The True case should contain your code/SubVI for the Write logic. Try it out & post back here. And, a VI or its snapshot would help us to help you more.
Also, start looking at the Producer-Consumer & Event Structure based design patterns in LabVIEW templates.
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 2 of 14
(3,477 Views)

hie parthbe,

as far as read operation i am not much informed but after user click it starts getting input till and do some calculations and all.as far my part i have to do some write process whenever i got command. so i have to takecare that read process do not interupted because of my work.

0 Kudos
Message 3 of 14
(3,471 Views)

The best option is to use state-machine architecture. Have you looked into it? Here is the NI KB.

Please post your VI here so I can understand better what you're trying to accomplish. 


Kudos are the best way to say thanks 🙂
0 Kudos
Message 4 of 14
(3,411 Views)

@winterishere8 wrote:

The best option is to use state-machine architecture. Have you looked into it? Here is the NI KB.

Please post your VI here so I can understand better what you're trying to accomplish. 


Wouldn't a state machine be a complicated way to have both things happening at once?

 

It sounds like he's trying to add functionality to an application that already exists without having much experience with LabVIEW.  It's unlikely he'll be able to completely re-architect the design.

0 Kudos
Message 5 of 14
(3,396 Views)

@winterishere8 wrote:

The best option is to use state-machine architecture.


From the title "how to read and write simulataneously", State Machine wont be much helpful. Maybe, you could have suggested Producer-Consumer. 🙂

- Partha ( CLD until Oct 2024 🙂 )
Message 6 of 14
(3,382 Views)
First, you need to provide the type of instrument/device to know whether or not a parallel operation is even possible.
0 Kudos
Message 7 of 14
(3,348 Views)

hello all....

i am using ni-usb X series DAQ 6343... sorry for being late..

0 Kudos
Message 8 of 14
(3,324 Views)
Then, yes you can write without disturbing the read operation. The most basic way is to simply drop a parallel while loop into the existing program. If you need some synchronization to the read, then it gets more complicated.
0 Kudos
Message 9 of 14
(3,318 Views)

hello all..  

 

         hie Dennis_knutson... as far as reading function i only know that it reads data continuously and do some processing.. so if user press some button particular write action should have take place. so plz guide me as per this requirement.. 

 

FOR Producer-Consumer way... should i have to change in reading functions? if anyone can provide some good and easy examples than it would be so helpful.

0 Kudos
Message 10 of 14
(3,301 Views)