06-04-2012 03:17 PM
I'm having issues on running this program. I am new to labview (1 week) and am trying to use the picomotor to move it in one direction for now. I have nested a While-Loop within a For-Loop. The user puts in 3 inputs:
1. xStart - The starting position.
2. xStepSize - The size of stepsize sample points the user desires.
3. xEnd - The ending position.
For example, if a user wants to start at 1 micron away from the starting position and wants to take 1 micron sample points and then can enter where they want to end, 11 microns away from the starting point of 1 micron. So it will take 10 sample points at 1 micron each until it reaches 11 microns. Hope this makes sense.
I decided to use the While-Loop for the stepsizes and add it up by each iteration until it is greater than or equal to the xEnd. This was then nested within a For-Loop that iterates it once and the xStart is on the outside of all this. I have attached the diagram for a better understanding.
I am also having VISA issues. I keep getting this error:
VISA: (Hex 0xBFFF0072) The resource is valid, but VISA cannot currently access it.
I tried to change the timeout of the VISA but still receive the same error.
If anyone can help me out with this I would really appreciate it!
06-05-2012 12:36 PM
Hello JonRod, so the problem is that the program gives you an error (besides the VISA error) or is only the VISA error you are getting? If so, what is the error?
Do you see the error at the very beginning of execution, or after it runs for a while?
If you use one of the examples attached with LabVIEW (Find Examples in the help menu) for VISA communication, does the picomotor work?
06-05-2012 01:56 PM
Thanks for the reply Eric. I appreciate your help. I've modified my diagram a bit and ended up taking out the for-loop since I decided I didn't need it. After the modification I was able to get rid of the VISA error I described in my previous thread but now I am receiving the error:
VISA: (Hex 0xBFFF006B) A framing error occurred during transfer.
I've been through the other forums that shows a solution that shows how to create a new block diagram, VISA Flush I/O Buffer VI described here:
06-05-2012 02:28 PM
I just decided to continue on and ignore the error for the current VISA error. It seems to work but it doesn't seem to want to get out of the While-Loop now. Even though I've configured a shift register compare the values of the xStepsize and xEnd. If the value of xStepsize is equal or greater than xEnd it should be designed to leave the loop and stop ('sto' command in the case structure) the movement of the xStepsize and xEnd motors. From the previous pdf image am I doing something wrong with the loop? Thanks.
06-06-2012 02:33 PM
JonRod, was the problem solved then? Bear in mind that you can also use the examples that ship with LabVIEW to learn about VISA and implement them in your code.
06-06-2012 03:14 PM
Yes that particular problem was solved but have encountered yet another error:
Yes, the person before me did use a lot of the examples but I have had to make a lot of changes to this main block diagram so I'm not sure if I'll have to make changes to them or not. Sorry, my knowledge of Labview is limited right now....still learning!