10-21-2010 04:42 AM
Helo
The vi attached is supposed to log current vs power.im supposed to see current changes on the front panel
under the current(A) string but it remains zero even when the current setting is not zero.another problem is when i run the vi i get the error message
error7 occured at open/create/replace file
can someone help with this
thanks
10-21-2010 10:02 AM
Don't know how we can help you with the current reading since you did not include any of the subVIs (and there's tons of them), and we probably wouldn't be able to run the code since we wouldn't have the hardware. The only thing I can suggest is to run the code with probes and/or highlight mode to see what's happening under the hood. You could have the "PSC_ETH Measure Current" VI open to see what its inputs are and what its outputs are to see if it is working correctly. If not, then you can put probes on the block diagram of that subVI to try to narrow down the problem.
Error code 7 is file not found. The "Open/Create/Replace File" function exists in one spot in the code, and that's in the bottom while loop in the True part of the case structure. In the first iteration the False part runs where a File Dialog appears asking you for the file to write to. This code appears to have been converted from an earlier version of LabVIEW. The enum that's wired to "access" input of the "Open/Create/Replace File" function does not match the valid values for that input in the 8.5 version of that function. You need to delete that enum and right-click on the "access" input and select "Create -> Constant" to create an enum with valid values. You also need to create an enum for the "operation" input and set its value to "open or create".
P.S. The code could stand a good cleaning. And get rid of those garish colors. Egads!
10-22-2010 04:45 AM
Thank you for the helpful response.I deleted and added those constants like u said.
I just want to ask you another question which i think will be easy for you
i have tried to use state machine on this application,and have only one while loop
i receive an error that case structure must have a selector value.also
On my front panel, there is RSD,STOP PROGRAMME,PAUSE AND STOP.while the
programme is running i want to use these functions.
Though you dnt have sub vi's can you advice how you think i can sort these issues out?
thanking you in advance
i have attached the changes i made
10-22-2010 09:27 AM
Well, what you have there isn't really a state machine. You said "i have tried to use state machine on this application,and have only one while loop
i receive an error that case structure must have a selector value." Unfortunately, I don't know which case structure you're referring to. I can tell you that the case structure that's all the way at the bottom is a really clumsy way of operating the program. What if this were built into an application? The user would have no way of doing what the dialog says.
I would suggest doing some reading on real state machines and producer-consumer architectures. You will find those contructs much easier to deal with and much easier to modify.