Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

error in reading variable in a infinite while loop in 7344 on board program causes the all the on board programs to quit?

Hi
I have written a on board program, in which i load a value in var 1 and var 2, then add these two and store it in var3 and then read this var3 and write it to a DAC. When I run this code, it doest run. i found that this doesnt run by checking on the max in the device resource.The code information disapears when i give the run command. I have attached the code with this mail. Please let me know whats the problem.
0 Kudos
Message 1 of 2
(2,862 Views)
Your mistake is in the load DAC value function. When you run functions in an on board program you must use input and return vectors (on board variables) to reference the inputs and outputs of the function (Similar to what you would do when passing a pointer in C). So in your program, when you substract variables 1 and 2 and then return the result to variable 3, you no longer need the read variable function to put the result into the DAC. I am attaching a modified version of your vi that shows how this needs to be done.
0 Kudos
Message 2 of 2
(2,862 Views)