02-06-2021 07:16 PM
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
02-06-2021 07:28 PM
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.
02-06-2021 07:50 PM
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.
02-10-2021 02:46 PM
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.
02-10-2021 11:30 PM - edited 02-10-2021 11:31 PM
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.
02-13-2021 12:43 AM
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.
02-13-2021 02:35 AM
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.
02-16-2021 05:48 PM
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.
02-16-2021 09:20 PM
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.
02-16-2021 10:07 PM
Ouch, that is what I was afraid of. Will attempt that. Thanks for all the help!