07-10-2012 01:38 PM
my system looks like the picture attached. Ideally, when user writes an input (User Input), there should be an output at the output terminal (DAQ Assistant 4). Then the Feedback (DAQ Assistant3) is able to read in data and trigger the function in the Mathscript module. The output of Mathscript module is then combined with User Input before written to the output terminal (DAQ Assistant 4).
When I run this code, the problem is that if there is not input to the Feedback DAQ, there is no value at the output terminal. What modifications are expected to make in order to solve this problem?
Thank you for your help.
07-10-2012 01:56 PM
I don't understand your question.
What input are you expecting to have go into the "Feedback DAQ"? It is reading an analog input channel, so it is going to output the data to go to the math node.
07-10-2012 03:21 PM
the user input is rotating speed and the feedback is rotating speed calculated from the output of an encoder. the output is voltage which is to control the inverter. Thank you.
07-10-2012 03:27 PM
Okay. You have a user input of rotating speed. And you have your DAQ assistant "feedback" of the speed from the encoder. You do math on those values and send the results out to the analog output through a DAQ assistant.
So where is your problem?
07-10-2012 03:29 PM
the problem is when i run the code. if there is no input to Feedback DAQ, the system wont run. but ideally it should be able to write an value to the output, and there there will ben a feedback.
07-10-2012 03:30 PM
" there should be an output at the output terminal (DAQ Assistant 4). Then the Feedback (DAQ Assistant3) is able to read in data and trigger the function in the Mathscript module. The output of Mathscript module is then combined with User Input before written to the output terminal (DAQ Assistant 4)."
If you want to feedback from 4 to 3, you have to use a shift register or a feedback node. This is because the dataflow of your VI is from 3 to 4.
FYI
In your second statement I think you mean you are writing to the input terminal of 4, yes?
07-10-2012 03:32 PM - edited 07-10-2012 03:33 PM
@Wei_W wrote:
the problem is when i run the code. if there is no input to Feedback DAQ, the system wont run. but ideally it should be able to write an value to the output, and there there will ben a feedback.
What do you mean that there is no input to the Feedback DAQ? That is going to be one of the first things to run in your VI and you will have a value based on the current speed detected by the encoder coming out of that DAQ assistant.
07-10-2012 03:42 PM
I mean that to run the test rig which is connected to this LV code, I need to write a value to the DAQ4 so that the motor can run at the given speed. only when it runs, the encoder will generate impulses. DAQ3 then can count it as the feedback.
07-10-2012 03:43 PM
YES. Could you let me know how to perform your suggestion? thank you.
07-10-2012 03:49 PM
A shift register in the loop will give you feedback. Can you start 3 with a "guess" value from 4?
Can you run one 4 outside the loop and pass it's value into the shift register that feeds 3 ( when you add the shift register that is)?