From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DC motor directional control

What version of LabVIEW do you have?

 

Downloading snippets isn't as easy as it used to be once the forums did an "upgrade" for images.  Now it is an extra step or two to get a valid .png file.

0 Kudos
Message 31 of 47
(1,019 Views)

I'm using Version 18.0

 

Could you please just attach the .vi file, seems like I am running in circles when I know we are close to solving the issue. I can figure this out, but I need the snippet vi to work.

 

I recreated your code based on what I saw in the image, but I'm not sure what the data type is that is being sent to the DAQout express vi. (The purple wires). 

0 Kudos
Message 32 of 47
(1,018 Views)

Attach your VI.  It is easier for us to fix what you've started then for us to create something from scratch.

0 Kudos
Message 33 of 47
(1,013 Views)

Sure, its attached below.

 

So because I can't figure out what the purple wires should be, I'm using DDT, but the DAQ Out Express VI is not accepting that data, hence the error.

 

Thanks for the continued help, feel like we're circling in on the solution. Appreciate it.

0 Kudos
Message 34 of 47
(1,007 Views)

I don't see any purple wires.

 

GerdW's snippet used the waveform datatype, a brown wire, and he used Build Array to combine them to a 1-D array of waveforms he fed to the DAQ Assistant.

You used Express VI's and they give blue "Dynamic Data Type" wires.  You need to use Merge Signals to combine those blue wires into one.

 

Blue wires are kind of evil because they hide what is really going on underneath them.  They often make things easier to connect because things will usually adapt to whatever they need to be to get rid of wiring errors.  But you really don't know what is happening, and they'll often adapt to some data type that is not what you really want.

 

I fixed your VI.  See how this works.

0 Kudos
Message 35 of 47
(1,003 Views)

Hi mm,

 

when you insist on using ExpressVIs (which you shouldn't) then you need to use JoinSignal instead of BuildArray.

 

On using my snippet:

1. Left-click the image in my post to start the forum-internal image viewer.

2. Here you will find a download button: downlad the image to your harddrive.

3. Drag&drop the image from your harddrive to your VI block diagram.

Done.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 36 of 47
(1,002 Views)

That's what threw me off.  For some reason when I clicked on that image, the download button wasn't there.  It actually is.  It is the right most box, but the icon is missing.

 

Capture

0 Kudos
Message 37 of 47
(999 Views)

Hi,

 

This helps. Can you clarify:

The joint signal going into the DAQ output, is it a 2 column array and each column is fed to one of the two output channels? How does this actually work? 

 

Also, I've noticed an on-going issue which is that once the motor begins running, even when I stop the execution (as in no longer generating a signal)! Why does this happen? Once I abort execution, shouldn't the motor lose power and stop running? 

0 Kudos
Message 38 of 47
(988 Views)

@mmotiwala wrote:

The joint signal going into the DAQ output, is it a 2 column array and each column is fed to one of the two output channels? How does this actually work?


Two signals on the wire correspond to the 2 channels in your AO task.  It is that simple.

 


@mmotiwala wrote:
Also, I've noticed an on-going issue which is that once the motor begins running, even when I stop the execution (as in no longer generating a signal)! Why does this happen? Once I abort execution, shouldn't the motor lose power and stop running? 

You need to stop the AO task.  There is an input to the DAQ Assistant to tell it to stop the task.  You should also write 0 to the task before stopping it since the DAQ will hold whatever was last written to it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 39 of 47
(986 Views)

Hi mm,

 

once the motor begins running, even when I stop the execution (as in no longer generating a signal)! Why does this happen? Once I abort execution, shouldn't the motor lose power and stop running?

All this would be SO MUCH EASIER when you start learning from the example VIs coming with LabVIEW and using plain DAQmx functions!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 40 of 47
(984 Views)