07-16-2015 05:48 PM - edited 07-16-2015 05:52 PM
The driver is just clearly written by something that does not program LabVIEW and is not familiar with coding in the dataflow paradigm, using standard sub-vi programming practices and normal documentation techniques. To be clear, this is not an insult. I write mediocre C at best. You can't be a master at everything.
Now, on to the meat of it, I rewrote/restructured everything you've written into a library that is documented and conforms to typical LabVIEW programming methodologies. I did this at first in industry because, quite frankly, it was needed to get my stages to perform reliably and with readable, scaleable code. The original code was loaded with race conditions and ambiguous execution and timing. Moreover, the structure just didn't make sense for writing larger applications. I went on to develop this as a library for release when I used it to code motion applications for customers.
The libray is here, for reference. It comes with all sorts of standard applications out of the box: https://www.interfaceinnovations.org/motionproducts.html
Now to the OP, I have strongly considered a rewrite using raw serial, but never got around to it because there just wasn't enough demand. All of my apps using the library were black-box executables on Windows machines, so it was unnecessary.
Cheers,
C
08-03-2015 10:24 AM
Hi all,
Configuring a new motor controller. I am using a mac so I am sending the command "SetMAmMx" in order to configure my controller. When I type "getMmM" I get the following response: "g?M256 M256" when I should be getting a number between 0-6. The same thing happens when I use "SetMmMx".
I want to make sure the controllers are properly configured before I start using the motors. How should I do this?
Regards,
Mridu
08-03-2015 10:36 AM
The VXM commands are "case sensitive" therefore the correct usage would be "setMAmMx" where the lower-case m is the axis number and the x is the axis setting,
AKA:
"setM1M3" would mean "set Axis 1 to use setting 3 (for a PK264 motor)
When you get a response something like g?M256 then the ? is the VXM is telling you that you made a syntax error.
08-03-2015 10:42 AM
sorry that was a typo on the post itself (I had typed it correctly in the code). I think i forgot "rsm" after that....
Now when I "getM1M" in the response I also see"getM1M" but do not see a number between 0-6..?
Thanks for your help,
Mridu
08-03-2015 10:56 AM
Also in the same manner, when I type "setM2M3, rsm" I get "setM2M3. rsm^" as my response, but when I do getM2M, I instead get "g?M256 M256".
To clarify, this is different from what I got by doing "setM1M4, rsm" --> "setM1M4. rsm^" and then "getM1M" --> "getM1M"
Any ideas?
08-03-2015 10:57 AM
It all depends on the timing of when you do your read (for instance if you read too quickly then you might see "getM1" and then read again you may see "M3"
General rule of thumb is that if you ask for a response then you should wait 100ms to 250ms to read the reply
08-03-2015 11:01 AM
I have a 500ms delay before my read. I though this was adequete because I was using this before with some old velemex motos/controller (that had already been configured prior). How do I know if it is safe to use my motors/motor controller and if they are properly configured?
08-03-2015 11:39 AM
When you mentioned " I was using this before with some old velemex motos/controller (that had already been configured prior)."
Were they VXM's?
If not, then are you using the same communication parameters?
08-03-2015 01:14 PM
I tested some, and you were right; it was a matter of chaging the read time, thank you!
Also, do you know what the termination character is for VXM? What I read in the manual said you could use a carriage return, comma, or period, but when I specify the carriage return as my termination character, I get a timeout error..
Thanks,
Mridu
08-03-2015 02:22 PM
Not all replies have a terminator character