Running two stepper motors at the same time from one port

Hello,
I have to run two motors at the same time - one used to move a linear ball screw and one to turn a grip. I am doing tension and torsion testing on small wires, but tension and torsion have to be done at the same time. I also have to build in the ability for each motor to take multiple steps, ie. have a motor take x number steps at y velocity and then move x number of steps at z velocity. Both motors need to be able to do this. However, I am having problems getting the motors to run at the same time and to take all the steps. The motors are connected to two RMS Technologies R356 controllers. Both of the controllers are then connected to one RS485 to USB converter card, and that card is connected to one of the USB ports in the computer. Currently, I pass an array of commands to two for loops each containing VISA read and writes. I've attached the vi to look at. All of the timing stuff in the code is because a new command cannot be sent to the controller before the motor is done executing the previous command. If commands are sent right after one another, the controller will only execute the first command and then return with an error. 
Does anyone have a suggestion as to what I am doing wrong?
Thanks in advance for any help. 
Solved!
Go to Solution.
Attachments:
Motor Controller (Sub VI 3).vi ‏41 KB

I'm not too clear on exactly what you are trying to accomplish or some of the details.
Are there equal number of torsion and tension steps?
Is there a pairing between a torsion and tension?  For example, you want to tension and torsion simultaneously, but those two together make a complete step?
Do you want to wait until both the torsion and tension have completed before moving on to the next torsion/tension pair?
Is there any time delay you want to hold at before moving on to the next step.
When working with state machines, it is important not only to define the states, but also the logical stepping from one state to the next, or alternatives based on conditions.  It could be flowchard, but sometimes people call them state charts.
Right now your latest posting has goes to "Write to Motor" event though and will wait there forever because there is nothing in the queue to write out through the VISA port.
Let's assume your first state would happen to be Enqueue Tension (in order to get something in the queue), you will actually queue up all your tension commands at once with the For loop.  Then i will be 1 less than the size of the array it always will be because for an array size n, i will go from 0 to n-1 on each iteration.  So your false case will run and you will go to "Write to Motor".  Write to Motor will run and dequeue the first command then go to Waiting for Response.  Waiting for response will iterate through the while loop until 66 or 67 comes back.  I assume only 66 will come back for tension since you have yet to write a torsion command.  Once that comes back, it will go to Enqueue Tension again and insert a whole other series of commands.  Then go back to write Motor and will take out the 2nd queue element from the first set of commands your wrote.  It will stay in a Tension mode and the Queue will grow endlessly putting in a whole new series for each element that you dequeue.
A state machine is the way to go, but I can't really sketch one out for you because I'm not sure exactly how your applications is supposed to work.  If a tension and torsion command are paired together,  perhaps you should just queue them together and write them out at once.   But the key thing is to sketch out on paper your application and flowchart exactly how the program should progress from step to step.
PS:  One other thing, make sure you wire the queue reference wire through all states.

Similar Messages

  • Can I export my sidecar files to two or more hard drives at the same time from one computer?

    Can I export my sidecar files to two or more hard drives at the same time from one computer?  How do I do this, if it is possible?

    Each image is imported into the LR Catalog from just one stated location on disk. And that is where the sidecar gets written.
    But if you want, outside of LR, you can have a file sync utility replicate all physical changes within those folders on disk, into other corresponding locations on other drives - which hold a copy of all the same images, and a copy of the sidecars too. This might happen continuously, periodically or on demand depending on the particular tool you use... for example, the Dropbox desktop app.
    If you also want to have your LR Catalog replicated, I think this can only be done when LR is not running and using that.

  • Can a mac mini be set up to run two separate users at the same time?

    I work for a middle school and we need to purchase 20 computers that will just be used to run internet apps. Though we have all Macs, we don't have a big budget and for this one use only, we are condsidering purchasing inexpensive HP all-in-ones for about $450 each. However, I was wondering if a Mac Mini can be first set up with 2 partitions, install the OS on both partitions, then run two different users, with two separate monitors and keyboards, at the same time? This way, instead of purchasing 20 Windows computers, we could purchase 10 Mac Mini's (and displays) and save money, and still be supporting just one OS throughout the campus.

    If you setup a server, as in the Mac OS X Server Installation, pages 23ff show configurations, you can have multiple users, but they must all have computers.  Some installations can be done with dumb terminals but that is not what you seem to want.  Unix machines do have a multiple simultaneous user capability but you still have to have a computer for each user, again, not what you seem to want to do.  Right now there are two other users logged in on my Sun workstation on the desk behind me...they are logged in because I permit them to do so.
    And last night for an experiment I connected my iMac and MBP by ethernet wire, logged in on the iMac, then logged in on the MBP and from there on the iMac...but I set up the network to permit that and then disabled it again.  You can create security holes doing things like this.
    As dwb points out switching from Apple to PC equipment is a false economy that lures in administrators.  In our county school system we had a superintendent who hired a good friend...who had PC-industry ties.  Decided to remove all Apple equipment from the elementary schools and switch to PCs.  It wasn't long before they ended up going on a 4-year cycle of "refreshing" the equipment, i.e., completely replacing all hardware in every school on a four year cycle.  Since my wife was a Media Specialist, aka librarian, and responsible for technology in her school, every four years she had to develop a complete school map of where each teacher wanted the computers in their classrooms, complicated by where the technicians predetermined the locations of the network wire drops, of course.  then teachers get shuffled over the summer and all the plans are for naught.
    Anyway, there really isn't a solution to your problem except to buy a large number of computers and let each student use one and have them networked to a server, print server, printers, etc.  This is not inexpensive and cutting corners will only cause headaches for you.

  • How to run two vi's at the same time, one uses an AI task with 8 AI channels the other a single AI and AO channel???

    Hello Everyone,
    Here is my situation.  I have one vi that is reading an AI task of 8 channels AI0 --> AI7 (one sample on demand) and also has control of all of the digital outputs on the board.  My problem is that I want to run another vi that will use the last AI channel AI8 and an AO channel AO0.  These two vi's do not need to know anything about one another but I do need them both to be running at the same time.  Currently when I try running the two vi's together both vi's crash and I get an error message stating that the AI8 pin is reserved.  AI8 is not part of the task and is not refrenced anywere in the larger vi.  I am assuming that this problem is do to the fact that the larger vi is occupying the DAQ board, cycling through the task when the smaller vi is requesting data from AI8 and the DAQ board cannot do two things at once.  The sampling rate on the smaller vi is not really that important.  Is there anyway I can get the smaller vi to read from AI8 and not crash??? Software and Hardware listed below.  Thanks in advance for any suggestions.
    PCI-6221
    Labview 7.1 

    Hi steve ,
    Sorry to say that you cannot configure and acquire from AI channels on a   Device simultaineously from 2 seperate VI's.
    regards
    Dev

  • It is Posible that I run 2 or more user account at the same time from one PC???

    I have core i7 2600 8GB ram based PC, and I want to add another display, keyboard & mouse to run another account on my same pc any way to run both account at same time??? or any other way???

    I don't thin you can unless you are running multiport server and even then you would need a special box to split out the KVM's of the extra machines. If you try to use a VM the only way that would work is if you rdp into the VM which I'm assuming
    you don't want to do. If you hook two keyboard and mice to the same computer you will be fighting for control with the other keyboard and mouse. If this is a bigger project really the only solution without having two pc's to begin with is multiport server,
    or a RDS server with thin clients.

  • Control two different parameters at the same time

    Two motors were connected each other rigidly. One motor controlled torque and the other motor controlled speed. I generated some torque and speed data which represented one cycle of motion from a motor simulation. I like to send these two different data sets (torque and speed) to two different motors at the same time. Torque data sends to one motor and speed data sends to the other motor to see the response of the load profile. In order to do this, I thought about using multithread, but I am not sure it will work for this application. Usually multithreading delay the CPU time so the overall control process might be delayed, right? If you have better idea, please let me know.

    If you are using one motion controller to control both motors, you will probably run into problems if you try to use multithreading on the PC. However, you can execute up to 10 programs (threads) at a time, in addition to host communication, using on-board programming. For more information on on-board programming please refer to the following tutorial: Developer Zone Tutorial: On-board Programming in FlexMotion
    Best wishes!
    Dawna P.
    Applications Engineer
    National Instruments

  • Running two rpd in obiee at same time in same machine.

    can OBIEE run two rpd files at the same time?
    if can, how to config it?
    I need to run these rpds in a single machine so how is it possible.
    could u plz sort out the issue.

    Yes,you can run two rpd files in single OBI server.But you need to have two different presentation server(machines) to access the web.
    Star     =     paint.rpd, DEFAULT;
    Star     =     Personal.rpd ;
    while configuring the ODBC select the option -CHANGE DEFAULT RPD TO : type the RPD name.
    This is simple and i don't see any performance or other issues

  • How to insert into two differents tables at the same time

    Hi
    I'm newer using JDev, (version 3.1.1.2 cause the OAS seems to support just the JSP 1.0)
    and I want to insert into two differents tables at the same time using one view.
    How can I do that ?
    TIA
    Edgar

    Oracle 8i supports 'INSTEAD OF' triggers on object views so you could use a process similar to the following:
    1. Create an object view that joins your two tables. 'CREATE OR REPLACE VIEW test AS SELECT d.deptno, d.deptname, e.empname FROM DEPT d, EMP E'.
    2. Create an INSTEAD OF trigger on the view.
    3. Put code in the trigger that looks at the :NEW values being processed and determines which columns should be used to INSERT or UPDATE for each table. Crude pseudo-code might be:
    IF :NEW.deptno NOT IN (SELECT deptno FROM DEPT) THEN
    INSERT INTO dept VALUES(:NEW.deptno, :NEW.deptname);
    INSERT INTO emp VALUES (:NEW.deptno, :NEW.empname);
    ELSE
    IF :NEW.deptname IS NOT NULL THEN
    UPDATE dept SET deptname = :NEW.deptname
    WHERE deptno = :NEW.deptno;
    END IF;
    IF :NEW.empname IS NOT NULL THEN
    UPDATE emp SET empname = :NEW.empname
    WHERE deptno = :NEW.deptno;
    Try something along those lines.
    null

  • Two instances running at the same time on one machine - error ORA-28547

    Hi,
    I am running Windows XP (32-bit) and Oracle 10gR2 (10.2.0.3) and would like to run two services at the same time (NE and NE2). Configures my listerner like
    listener.ora
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
          (PROGRAM = extproc)
        (SID_DESC =
          (SID_NAME = CLRExtProc)
          (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
          (PROGRAM = extproc)
        (SID_DESC =
          (SID_NAME = NE)
          (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
          (PROGRAM = extproc)
        (SID_DESC =
          (SID_NAME = NE2)
          (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
          (PROGRAM = extproc)
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = dgregor-d630)(PORT = 1521))
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      )tnsnames.ora
    # tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    NE2 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = dgregor-d630)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = NE2)
    NE =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = dgregor-d630)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = NE)
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
      )I am getting error
    ORA-28547: connection to server failed, probable Oracle Net admin error
    In the registry I am aware of the ORACLE_SID entry, but it is reserved only for one value (NE or NE2).
    How should I configure it to run both Oracle services at the same time?
    Thanks!
    D

    Hi,
    Please post your question in the appropriate forum/group.
    Database
    http://forums.oracle.com/forums/category.jspa?categoryID=18
    Thanks,
    Hussein

  • Robotics-Running two stepper motors

    Hi
    I am working with LIFA (labview interface for arduino) to run two stepper motors to create a special (simple) path on XY plane. The example code (Arduino Stepper Motor.vi) works fine with one motor, but I don't know how I can modify it so that two motors can move with one time pushing the button, one after another while taking turns. Any Ideas? 
    The motion plan is as follows: 1. Motor 2 is stationary and motor 1 moves the load for 100 steps in X direction, then it stops and motor 2 starts to move the load for 70 steps in Y direction. 
                                                           2. The same as 1, only the direction of motor 1 motion is reversed, and motor 2 moves 85 steps instead of 70 in the same direction.
                                                           3. Repetition of 1 and 2 for 4 times with different number of steps at each level.
    I have twe big easy drivers, and one Arduino Uno.
    I truly appreciate your help,
    Best,
    Ashkan

    You could create a state machine.
    You could create a movement recipe where you enter in each sequential movement, and the code steps through the recipe one movement at a time.
    You could create some combination of 1 and 2.
    How do you want it to work? Are these steps going to remain constant, or do you want to be able to change them from one run to the next? How much do you know about LV? Have you any code that you wrote? What is the long term goal -- are you building towards something specific or just learning for the sake of learning?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Play two video files at the same time.

    I am trying to play two video files at the same time. I create two threads, each of which has its own frame, playing button, and builds its own graph to play the file. Now everything seems works except that when the first file is being played and I hit PLAY
    to play the second file, the program plays the second file but the first one is paused; furthermore the control button has no response for the first one. Did I miss anything? Can anyone help me figure out the problem?
    Best,
    Fayin

    You don't need separate threads for 2+ playback pipelines because the filters create worker threads internally and don't block execution on calling thread.
    If you decide to keep separate threads, you will have to follow Michel's advice and have message pumps on those threads.
    You can also have both files in the same graph, in which case you have perfect sync between them (both start playing together in sync), however you cannot pause/stop/run files separately.
    The problem you described is most likely not a DirectShow problem and is rather about generic threading, COM or window messaging.
    http://alax.info/blog/tag/directshow

  • Collecting data from advantech-usb4704 with two different apps at the same time

    I wonder if I can access to Advantech-4704 with two different applications at the same time?
    I use this block in my vis.
    I have enough ports, but inputs are needed in completely different applications. Do I have to close one of them or can they run simultaneously?
    Thankyou!

    Dear gtu,
    as nathand said, usually it is not supported to access the same physical resource simultaneously from multiple programs. In case of DAQmx for instance, you will get an error message which says that the resource is already reserved. I suppose the same would happen with your driver, however it might be worth a try.
    One workaround could be however if you revise your applications and merge the codes if it is possible so that no concurent resource allocation takes place.
    Best Regards,
    Adam Cseh
    Applications/Systems Engineer
    National Instruments

  • What do you think about running 2 security solutions at the same time? [malware event]

    Hi all
    Is there anyone here running 2 Security Solutions at the same time?
    From what I know, few of my lecturers are running AVG and Avira, or Avira and MSE. (All free)
    According to their theory, school-licensed Symantec Endpoint Protection slows down the system too much till a point that it is slow or unable to detect the threats. 1 antivirus is not good enough, 2 antivirus would be able to detect 100% of malware.
    For my school labs computer, they are running both Symantec Endpoint Protection and Microsoft Security Essential at the same time.
    Does 2 security solutions or more helps your computer to be risk-free?
    Cheers 
    Peter
    (Current: W520 4284-A99) (Refunded: W510 4876-A11)
    =============================================
    Does someone’s post help you? Give them kudos as a reward, as they will do better to improve 
    Mark it as solved if the solution works for you, so it could be reference for others in the future 
    Dolby Home Theater v4 (ThinkMix V2)!
    http://forums.lenovo.com/t5/W-Series-ThinkPad-Lapt​ops/W520-Sound-Enhancement-Thread/m-p/451401#M155... 
    Solved!
    Go to Solution.

    Hello,
    Generally speaking, you should not run two security programs together at the same time which run in "real-time," e.g., they are actively monitoring the system.  The reason for this is that the various real-time components (on-access file system scanner, network traffic filter, and so forth) may interfere with each others operations as they both attempt to access the same bits at the same time.  This can lead to all sorts of strange system behavior, such as slowdowns, program crashes, failed downloads and lock-ups.
    If you are going to do this, make sure you disable the realtime scanning components of one program, or use one program to actively monitor the system and the other to periodically perform an scheduled or manual scans on demand.
    Regards,
    Aryeh Goretsky
    I am a volunteer and neither a Lenovo nor a Microsoft employee. • Dexter is a good dog • Dexter je dobrý pes
    S230u (3347-4HU) • X220 (4286-CTO) • W510 (4318-CTO) • W530 (2441-4R3) • X100e (3508-CTO) • X120e (0596-CTO) • T61p (6459-CTO) • T43p (2678-H7U) • T42 (2378-R4U) • T23 (2648-LU7)
      Deutsche Community   Comunidad en Español Русскоязычное Сообщество

  • How to sync with two computers not at the same time, I'm registerd with one computer

    How to sync with two computers (not at the same time), I'm registered with one computer and am trying to connect with second computer with same iPhone. To sync the first time with the second PC "Firefox Sync Option tells me Create New account or Connect, when I connect it gives me a Passcode and on iPhone it also gives me a Passcode, than how do I connect? Both the iPhone and PC gives me a Passcode and have now idea what to do with them.
    Where do I find my Sync Key ? so I can install manually if it works ?

    Use the Sync Key ''(Recovery Key)'' from the PC that you used to initially setup your Firefox Sync service, when setting up that 2nd PC with Sync. You need to use '''Add a device''' to setup the 2nd and subsequent devices on a Sync account. <br />
    https://support.mozilla.com/en-US/kb/add-a-device-to-firefox-sync

  • HT201236 I want to do something so simple that there are no instructions. I just need to have two windows open at the same time so I can transfer files from one to the other by drag

    I want to transfer files from one device (or page ) to another by drag and drop , so i need two windows ope   at the same time,
    I know this can be done but I have forgotten how

    Don't use any full screen options for any app that has them
    Mount your device and double click on it to open it. Drag this window to the upper right of your Desktop and resize it to a bit less than half of your Desktop.
    Open the next folder and position it on the lower left side and resize it so you can still see the previous window.

Maybe you are looking for

  • Start up results in Folder with a happy face??

    Hello all, When ever I start up in Panther, I get the little folder with the smiling mac face and then Panther loads. What does this mean?? Thanks JerBear65

  • Trouble Restoring to Vista Factory Default

    I have had a Thinkpad T61 (6460-66U)  for just under a year now. When I first got it, it was pre-loaded with Vista and came with XP Pro recovery CDs.  Since it only had 1G of RAM in it, I opted to burn out a Vista Recovery DVD with the ThinkVantage t

  • Starting up a new macbook

    Just bought a MacBook and am trying to get registered and start using it, but it is asking me to specify what wireless system I am using. I don't understand. Isn't AirPort already installed in it, and doesn't it use whatever system is in the area...s

  • HT4623 how to fix the itune error an unknown erroe occured (310)

    how to fix the itune error an unknown erroe occured (310)

  • 'Assign resources to all ISA' Error (Neo2 Plat.)

    finally put all my new components together on my new MSI Neo2 Platinum board.  however, its locking up shortly after boot.  Using the MSI D-Bracket, it's telling me its locking on the 'Assign resources to ISA' step.  my component are below, but the o