LabVIEW + Arduino PID controller (Hardware in the loop)

hi.
i am new with forum part of Arduino, so i wish that i am on the right place and excuse me because of my language :slight_smile:

i have a transfer function (a dc motor transfer function (speed control with voltage)) in labview. i want to design a PID controller on arduino for that transfer function. I know that it's possible to design the controller in labview too but i need the controller on Arduino.

so i have the PID codes for arduino and i use VISA to connect arduino to labview. (i attached them). my problem is that it doesn't work correctly.I used PID library too but it does not work.what's the reason?
it's because of the codes?
or because of the VISA?

i tried this code for a real dc motor and it worked correctly. but it doesn't work for the transfer function.

Thank you...

pi_new.ino (764 Bytes)

pi_new.ino (764 Bytes)

What does "does not work" mean?

Explain that!

.

Thanks for your attention.
when i run the labview, it can read an write from serial. but the output should be 100 and stop on 100 (Vref in code) but the output increase and never stop

theseyedjafari:
Thanks for your attention.
when i run the labview, it can read an write from serial. but the output should be 100 and stop on 100 (Vref in code) but the output increase and never stop

what output should be 100?

what should stop on 100?

Sounds like you have bugs in your code whichever one is causing these two problems.

I suggest you troubleshoot.

.

I means output of labview...
do you see my labview VI?

theseyedjafari:
I means output of labview...
do you see my labview VI?

I get paid to program in LabVIEW.

One does not "see" the VI from a JPG.

.

the forum did not allow me to upload the file with " .vi " format

theseyedjafari:
the forum did not allow me to upload the file with " .vi " format

Since it is a bug in your LabVIEW VI, I suggest asking for help on the LabVIEW forum.

.