LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Testing Communication with USB RS422 for a stepper motor in LabView 2013

Oh, hmm, I am a bit confused. I was under the understanding that I didn't have to write any commands in order to test the communication? I thought I just had to use the NI-MAX and follow this link to test the communication: 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1jtCAA&l=en-US

0 Kudos
Message 11 of 20
(1,132 Views)

You could test through NI MAX, but you still have to know what to send and receive. The fact that you can select the com port means that LabVIEW can see the comm port and most likely can send and receive data with it, but that doesn't tell you if you can communicate with the device. For that you have to actually do something, IE send and receive data from the device.

 

Use the example I showed you and make sure to have an indicator for the error and buffer coming out of the visa read. Those two pieces of information will point you in the right direction even if the communication fails.

0 Kudos
Message 12 of 20
(1,130 Views)

Oh okay, that makes more sense. Will attempt that and report back as soon as I have access to the equipment. Thanks for all the help.

0 Kudos
Message 13 of 20
(1,125 Views)

I have attempted your suggestion and I got the following error: The error was -1073807298 (Hex 0xBFFF003E).

I looked online for that error and it seems to be an error due to other 
processes using the I/O ports of my device. I closed all application that may have used that port and reattempted it and I still get that error. I have attached an image and the VI that I used to test: initialize_motor.vi and test.vi. Also, I have attached a missing subvi highprec6.vi that I forgot to add previously.

0 Kudos
Message 14 of 20
(1,095 Views)

Sorry, was pretty busy at work today didn't see your reply till now.

 

The VI you uploaded never closes the port. I am guessing that error came after the second run, or perhaps you have another program open using that com port. Make sure nothing else is using the com port and close the port at the end of your code.

 

Also you don't need bytes at port. The device uses a line feed for a termination character which is the default for the visa configure port. Just enter a a number of bytes to read larger than anything you expect to see and visa read will read until it sees a line feed or times out.

 

test.png

0 Kudos
Message 15 of 20
(1,084 Views)

Hi no worries! Thanks for the suggestion however I still unfortunately still get the same error using the vi you have uploaded. I have attached the error. I closed all applications that was making calls to the port. I even disconnected the power supply and the USB and I still get that error.

 

0 Kudos
Message 16 of 20
(1,056 Views)

Kinda sounds like a dodgy serial adapter to me.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6FmSAK&l=en-US 

 

You can try the steps in that, if it were me I would spring for a new adapter. You can get a decent one for $25-$40 bucks. I've had no issues with the ones from SerialComm.

0 Kudos
Message 17 of 20
(1,053 Views)

Will it still be a serial adapter issue even if I am able to communicate with the motor with the already installed software through the same rs422 usb drive? It is only through LabView i am unable to communicate with the stepper motor.

0 Kudos
Message 18 of 20
(1,036 Views)

Hard to tell. I guess you could run the original program and see if you get the same error there. If not you might be able to figure out what setting the adapter doesn't like, my guess is you could spend days troubleshooting that. 

0 Kudos
Message 19 of 20
(1,023 Views)

Ouch, that is what I was afraid of. Will attempt that. Thanks for all the help!

0 Kudos
Message 20 of 20
(1,015 Views)