LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Write - Write a variable in serial port continously - Help

Hello,

 

I have implemented a PID in labview and it gives me an output variable(numeric). I need to write this output continously in the write buffer of the VISA write function without clicking any botton. I mean I would like it could do it automatically and continously with a fast speed. I have tried many ways but I can´t get the way to do it. I would appreciate any help.

 

Thanks

0 Kudos
Message 1 of 5
(1,201 Views)
In the loop that you have the PID, take the numeric output, format into a string that the instrument understands (i.e. with Format Into String function), and wire that to a VISA Write. Your question is pretty generic with no details on the instrument or any code attached.
Message 2 of 5
(1,192 Views)

Hello killernur,

 

As Dennis_Knuston say, thereis no too much information. Providing more detailed information, attaching the VI or a screenshoot we could help you in a better way.

 

In any case your problem come from the configuration of the VISA resource. The steps after that are one that Dennis mentioned: the numeric output, format into a string that the instrument understands (i.e. with Format Into String function), and wire that to a VISA Write.

 

Here there is attached a explained VI with the features that you demand.

 

If it does not work, don't hestiate to ask again. 

If it work remember to rate the answer so other users can use this information.

 

Hugs!

 

Message 3 of 5
(1,122 Views)
Hello, sorry for not answering before but I already solved the problem. Thanks anyways😄
0 Kudos
Message 4 of 5
(1,107 Views)

Hello artuntun, I opened the file you uploaded and I would appreciate if you could explain me this part. I understand that the first timer returns the value of the millisecond timer and the second one executes the loop each time the millisecond timer is a multiple of 15, right? But I dont understand the substraction what is doing. And for what is used x-y? (FIRST PICTURE)

 

In my case, I would like that the PID loop execute every 10ms, but I didn´t implement it as you. In the second picture you can see the way I did it but I am not sure if it is right. What do you think?

 

Thanks

0 Kudos
Message 5 of 5
(1,078 Views)