LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sy

Dear all, 

 

I need help to solve my problem which about synchronize the input voltage with output. I am trying to write a code that can synchronize the output voltage ( to the actuator) with input voltage (from the sensor) with changing the offset voltage (Dc voltage) while the code is running.

I have tried to test the code by connecting the input with output voltage as can be seen in the attached figure.

I found there is a delay between generating a date and acquiring a data by (Fs* number of sample). For example, if i set the number of sample (10000 )and sampling rate (1000 Hz), the delay is 10 s. I need to improve the code where it can write and read simultaneously with changing the offset voltage (Dc voltage).

 

Could do you please  help me to improve this code.

 

Khalid

0 Kudos
Message 1 of 17
(3,435 Views)

Synchronization input with output

0 Kudos
Message 2 of 17
(3,432 Views)

Yes, reading 10k samples at a rate of 1k samples/sec takes 10 secs ...

Read 1k samples at a time, e.g.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 17
(3,423 Views)

hi Yamaeda, 

 

Thank you very much for your reply. 

 

Actually, I need to chane the dc voltage while running a code, but the code does not acquire with generate the voltage simultaneously. Do you have any clue how i improve the code. I need this code to do control system.

 

Khalid 

0 Kudos
Message 4 of 17
(3,416 Views)

In general, you want a Feedback node (shift register) in the loop to push information between loop iterations. In this case you'll need the output as feedback to next iteration to correct/change the output.

Drag the output to the loop border and change it to Shift register, then you can use the "previous iteration information" in the next iteration.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 17
(3,403 Views)

Hi Yamaeda, 

 

I have added shift register to the task out as can be seen in the attached file, but still facing the same problem.

 

Khalid

0 Kudos
Message 6 of 17
(3,388 Views)

Hi Yamaeda, 

 

Actually, I am new and not expert in this field. Could do you help me please?

I do not know which output I should drug it to the board to do shift register?

 

Best regards,

Khalid

0 Kudos
Message 7 of 17
(3,374 Views)

Hi, Khalid1,

 

How about disconnect the terminal of number of samples per channel of the DAQmx Read.vi?

0 Kudos
Message 8 of 17
(3,333 Views)

Hi Khalid. Placing the VISA resource in a shift register is recommended, so it's all good. What you're after, however, is to send the actual reading to a shift register so you can access it and correct your values, probably the current input also. That way you can adjust the input depending on what the output was last iteration.

Do that and run the VI in Highlight and Retain values mode (the 2 lights on toolbar) and you'll see how it works.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 17
(3,322 Views)

Hi khalid,

 

is there a reason why you ask the same question using a different user account?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 17
(3,316 Views)