star Posted March 15, 2009 Report Share Posted March 15, 2009 Hi all, I have made a code that moves the motors by sending the command MR (Move relative position) to the PM341, however, how would i send a squence of movement to the stepper motor. When I look at the at the PM341 user handbook (link below) , i found a command called DS (Define squence). This command can be used but i don't know how i would send it. I have also attached my code. http://www.mclennan.co.uk/datasheets/techn...1manualissb.pdf Quote Link to comment
Justin Reina Posted March 17, 2009 Report Share Posted March 17, 2009 Hey star, First, you should give me that driver, I want one... In short send a string of the commands delimited with the 'EOL' character. See attached. Beyond that, I think there are few things to maybe ask about. (1) Serial COM in the LV environment - I've attached a documented basic example. (2) Software Architecture in LabVIEW - There are much simpler ways of accomplishing your tasks with more brevity and robustness Best of luck. If you are interested in (2) let me know and we can work through it. It shouldn't take too long. -Justin Quote Link to comment
star Posted March 17, 2009 Author Report Share Posted March 17, 2009 Hi Justin, I would be happy to go through it with you because I took the multi-line list to array of string.vi from another code and if you could make it easy to understand it would be helpful. Quote Link to comment
Justin Reina Posted March 17, 2009 Report Share Posted March 17, 2009 Hello Star, What kind of constraints do you have for your system? The particular function you have found seems to have been very carefully thought out and robustly implemented. As such, it is way complicated If you are simply controlling something in the lab, or perhaps a rp/demo/proof-of-concept then type situation this type of function is unnecessary (and dangerous to use unless you know exactly what its doing). However if you are controlling a satellite, this may be a different story, and you probably would use nothing less. Which situation suits your fancy? (Hint: option 'B' takes a lot of work). -Justin Quote Link to comment
star Posted March 17, 2009 Author Report Share Posted March 17, 2009 Hi Justin, I am controlling two steppers motor (motor x linear and y polarized). So A Quote Link to comment
Justin Reina Posted March 17, 2009 Report Share Posted March 17, 2009 Try this. Let me know what questions you have. If the 'queue' idea is a little fuzzy, try looking into 'QSM'. -Justin Quote Link to comment
star Posted March 19, 2009 Author Report Share Posted March 19, 2009 QUOTE (JustinReina @ Mar 16 2009, 10:21 PM) Try this. Let me know what questions you have. If the 'queue' idea is a little fuzzy, try looking into 'QSM'.-Justin Hi Justin, Sorry for the late reply and thank for your input. However i couldn't understand your code and how it would be useful for replacing the multi-line list to array of string.vi. Also when i ran the program i received the following error message: Error-1073807253 occurred at VISA Read in StepperOption.vi Possible reason: VISA: (HEX 0xBFFF006B) A framing error occurred during transfer. Quote Link to comment
Justin Reina Posted March 19, 2009 Report Share Posted March 19, 2009 Hello star, The error is because the serial port wasn't configured correctly, check the settings on 'configure port' VI. With regards to the multi-list string function, what function are you trying to accomplish with it? Is it a mechanism to 'log' the previous states? -Justin Star, My apologies, I did not read it correctly. Is that function a mechanism to execute a sequence of states? -Justin Quote Link to comment
star Posted March 19, 2009 Author Report Share Posted March 19, 2009 Yes, that function is used to execute a sequence of states. Also how do i correctly configured the serial connection. Quote Link to comment
Justin Reina Posted March 19, 2009 Report Share Posted March 19, 2009 Cool. Maybe try this. It uses queues to make things a little easier to manage. made a polymorphic vi for 'send' so you can 'queue' up your states to execute. If you have any questions let me know. If you are interested, maybe scheme up a way to send a sequence of messages (i.e. instead of just sending a data message like it is currently, maybe send a state+data). -Justin To configure the serial port, take a peek at the 'simpleserialIO' vi up top. The 'configure port' vi has inputs for com rsrc,baud,data bits,stop bits, etc. -Justin Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.