01-16-2013 04:47 PM
Dear all,
we want to implement a Labview code for controll a Velmex bislide with a VXM stepping Motor controller. At the moment we dowloaded a file from their webpage it is called minimum code to run.
http://www.bislide.com/controls/faq/labview/labview_8/ex_examples.htm
We want to have a screen where you can change the velocity, the position, the number of steps desired, the type of steps, the direction of the motors.
We don't know how to implement it. Here we are attaching our file Minimum code to run.pruebas.vi that we have. Could someone guide us?
Thank you very much,
Laia
01-16-2013 06:19 PM
Laia,
Velmex makes beautiful mechanical parts, but their electronics and software are definitely not in the same class. I used one of their devices in a system which had to run a about 1% of the minimum speed they said it could run. We got it working, but they were not much help.
Now, to your question.
First. I recommend that you get rid of the sequence structure and learn how to use a state machine architecture. Also, look at the Producer/Consumer (Events) Design Pattern. That will allow you to use an event structure to handle the user interface and with a state machine in the Consumer loop to be versatile about the motion.
Second. Consider rewriting that VxmDriver. Make a spearate VI for each of the functions (as defined by the collection of isolated case structures. You can eliminate most, perhaps, all of the boolean switches. Add error in and out clusters to your VIs. Document what each function does. Use the standard 4-2-2-4 connector pane.
Then put the VIs you need in the various states of your state machine. You should end up with a program which works reasonably well, is easy to understand, easy to modify or extend, and looks good.
Lynn
01-17-2013 02:22 PM
Dear Lynn,
First of all, thank you very much for the information. On the other hand, Could you help us a bit more. We are new using Labview. So, at the moment we had split all the velmex process in diferent VI's. And we made a State machine following this: http://www.ni.com/white-paper/7604/en. Do we need an state for each VI?
Thank you very much for your help,
Laia
01-18-2013 01:26 PM
johnsold,
Could you elaborate a bit on what you found lacking in the electronics and software?
You mentioned 1% of the minimum speed, what speed was that? did you configure the control?
Laia,
you may want to also post your questions in the Velmex forum at http://groups.google.com/group/velmex-controls
As your questions are more "device-specific" you may find an answer there much quicker
01-18-2013 07:13 PM
Laia,
No, you do not need a state for each VI from the driver, unless you use all of them.
Your states will be like the frames of the sequence structure in your Minimum Code program. I did not call that program up now, so I am working from (fuzzy) memory. Some states, like waits, may be repeated. You do not need multiple wait states. I think I recall that at least one frame had a loop. The state which performs the function of that frame will not contain a loop like that. Each time the code enters that state it will perfrom the work of one iteration of that loop. You may need to add a shift register containing the iteration count for that state so it can determine when that task is complete.
Lynn
01-18-2013 07:27 PM
Velmex,
I am not working at the place where we used your products any longer so I do not have access to the information.
As I recall the motion needed to be very slow. About 1 step every 90 seconds or something like that. We ended up generating a pulse which we sent to the Jog input when we wanted to move one step. I ran some tests which ran for a week or so to move the slide from one end to the other. The final system was all hardware, no software. I think I used software to generate some of the pulses in the preliminary tests before I built the hardware generator.
If the VxmDriver VI which Laia posted earlier in this thread was your product, it lacks documentation, has >25 connections on the conn pane (standard is 12), has some inputs on right and some outputs on left, has a block diagram much too large to fit on one screen, uses local variables inappropriately, uses sequence structures inappropriately, has excessive bends in wires, and so on.
Lynn
01-20-2013 10:39 AM
Lynn,,
Although I will agree that the slowest speed is 1 step per second. One could easily program the control to take a step, wait 90 seconds, and then take another step.
For example from a view of a program stored in the control to be later run "Stand-Alone"
F, ;VXM Online
C, ;Clear current program
S1M1, ;Set Motor 1 Speed to 1 step per second
LM0, ;Set Loop Marker
I1M1, ;Motor 1 Move
P900, ;Pause 900 (10ths of a second) = 90 seconds
L0, ;Loop to Loop Marker forever
Doing it the way you did is also feasible but requires some external device to keep track of time and give an output to trigger the VXM jog button (and turn it off before the control takes more than one step)
The VI that Laia posted was indeed originally what I wrote (with some minor modifications) however the documentation was not uploaded with it. (That and your comment of not having access to the information makes me want to say that the original comes with all the necessary documentation in a folder marked "HOW TO USE VXM DRIVER" in the examples folder) this can also be downloaded from VelmexControls
I will admit that 1 VI with multiple connections can be confusing, but so was multiple VI's each doing 1 small thing. I am looking into a concept that a colleague contributed at the Velmex Forums that shows the VI as not being viewed as an icon which makes things cleaner to read.
Along with that I am also looking into making each VI do 1 process only so that each VI is more "Self-Documenting" as to what it does.
Cliff
01-20-2013 11:50 AM
Cliff,
The documentation you linked is pretty good (at least at a quick glance). The LabVIEW Style Guides suggest that such information should be included in the VI documentation.
I would prefer an enum (typedefed) to select the function rather than a gazillion booleans. I will conatact you by PM to discuss some other ideas.
The user wanted to be able to change the speed over a wide range and did not plan to have any computer in the final system, so we opted for a hardware solution using a set of thumbwheel switches to set the interval between pulses.
Lynn
01-20-2013 08:16 PM - edited 01-20-2013 08:44 PM
Hello all!
In my experiences with Velmex slides - which are hands down the best product for the money, IMO - I found the programming to be greatly simplified by adding another level of hierarchy to enhance ease of use. What this results in is a simple "move" block that takes a few inputs and handles the conversion of user-readable commands (something resembling an array of move vectors in inches) into the command format accepted by the controller. Inside this simplified vi,the sequence of operations in the flat sequence is carried out transparently, resulting in cleaner and more readable code. You can then build all sorts of fun stuff on top of that, like joystick function, configurable step movements, macro learning, etc.
The use of one "multifunction" vi is not typical programming style for LabVIEW drivers, and while some might argue this is a matter of preference, it is certainly not what most LabVIEW users are accustomed to. While speed of command execution has not been an issue for me using the Velmex multifunction driver, the separation of the functions into a toolkit of vis performing smaller functions enables the user to perform only those functions necessary for the particular operation, if they wish to optimize the operation.
Overall, by adding a simple "move" block, but also having a tool kit of primary functions, you extend the usability to those that just to tell the slide(s) what to do, but also enable those that want to fiddle with primary functions more power to do so.
Laia, I'm not sure what progress you've made on your particular design problem, but if you're interested in talking about a front-end solution for your applicaiton, please drop me a message. I can send you some examples of interfaces I've written for the devices.
Best Regards,
Colin
01-22-2013 01:12 PM
Dear Collin,
Thank you very much for all, at the moment I am not finding any solution. Now, I am reading all the information about VISA comands. However, if you could help me I will be very grateful.
Thank you for all,
Laia