08-09-2011 02:40 PM
Hi all, I recently posted on these forums involving the same LV software and while my previous problem was solved, it looks like I'm back again with a few new problems.
I have created a program that essentially controls current via a power supply by monitoring a rate and checking parameters to then use this information to adjust the current accordingly. I am using a MASTECH HY3020MR PS with a Sycon QCM rate monitor, both hooked up to my PC via RS-232 cables.
The vi and loop seem to be running properly now, which is great news, but I am still running into a problem when turning the control on, allowing the program to regulate the current opposed to doing it manually. It would appear that everything runs properly and that the logical boolean statements do what they should in terms of adjusting the current accordingly, but as soon as we turn the control on, the current immediately drops off and then stays around 0.5, which is close to the zero it maintains at 0.3 for the current. Ideally, the current should remain in the range of 1 to 1.6 amps, which is where we begin it when manually adjusting before the automation is turned on. However, every time we start up the control, it then drops off.
Does anyone have any suggestions as to why this is happening? I have attached the most recent version of the vi with all necessary subs. The main program is FBControlLoop-noPSloop.vi and the problem happens when the "Control on" option is selected. This problem is perplexing me and other people I have contacted who are good with LabVIEW since it seems as though everything works in simulation, but when running the actual program in automatic mode, something seems to happen that doesn't make sense. Thank you to anyone who can help!
Will
08-09-2011 04:21 PM
Will,
It looks as though you have an unitialized feedback node setting the current setpoint to HY3020MR-noloop.vi. The first iteration it will provide the default value for the datatype. For DBL that is 0. So you set the current to zero on the first iteration.
With all the local variables in the simulation VI, it is quite possible that some race condition exists there and it may not work as expected. Generally local variables and sequence structures are to be avoided as they break dataflow, are hard to maintain, and are inflexible when modifications to the code are required.
Lynn