From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-19-2011 06:44 AM
Hello,
I am trying to send commands to a motor control through COM port. Since I am working on a laptop, I use a Keyspan USB to RS-232 adapter. I mapped the adapter to COM4. If I use a serial capture program (vista unfortunately does not have hyperterminal), I can send the commands perfectly and the motor responds correctly. When I try to implement some automation in LabVIEW it gives me some errors. First of all I need to configure the COM port baud rate to 19200. When I do this, LabVIEW returns an error in arg 8 of the configure VI. I looked this up and it means that arg8 of the property node is giving a problem (This is the argument to change the flow control). However, I set the flow control to the (in the motor manual) described value: None.
If I try to just open the COM port (without making changes to the configuration) and try to write a string like "jof" to the serial port, it gives another error, that the communication is lost.
Anyone encounter this before?
Thx
01-19-2011 07:42 AM
Best guess is that you are running versions of Labview and NI-Visa that are not compatible with Windows7. What version of NI-Visa are you running?
01-19-2011 09:05 AM
Hi,
I am running LabVIEW 8.5 on a Windows Vista 32bit. How do I check which version of NI-VISA I am running?
Thx
01-19-2011 09:14 AM
Open "Measurement&AutomationExplorer" and have a look at the left column. Open MySystem-Software, there is NI-VISA. Klick it, on the right side you see infos about it.
01-19-2011 09:43 AM
@anita Zahr wrote:
Open "Measurement&AutomationExplorer" and have a look at the left column. Open MySystem-Software, there is NI-VISA. Klick it, on the right side you see infos about it.
The NI-VISA version is 4.5.1. Additionally, I should say that when I user the Measurement&AutomationExplorer, I can perfectly send commands like jof\r to the device, and it will act the way it should. The problem however, still remains that I cannot do it from a LabVIEW VI.
01-19-2011 09:47 AM
The fact that you can communicate from MAX proves that my theory is not correct. Can you post your vi?
01-19-2011 10:13 AM
Hi,
I seemed to have solved the problem myself. I guess before there was some other instance trying to use the COM port resulting in an error when I tried to open the port. I now can set the baud rate etc. and can read. It took me some time to figure out that the string (which is read to the serial instr) has to be set to '\' Codes display instead of the default setting. This solved my problem I think. I will try the complete program tomorrow to see if everything runs as it should and I will post here the result.
Thx
01-20-2011 05:01 AM
It really seems to work now, but I have an additional question regarding this topic. Can anyone help me or direct me to information about the timing w.r.t. COM ports? Because I built in a delay between a write and read command of 500ms, but the shorter it is, for me, the better 🙂
Thx
01-20-2011 05:56 AM
1) Write command
2) Read PropertyNode "Bytes at serial port" in a loop,
until you get at least one byte, wait a very short time within the loop
3) Read Bytes (one by one until termination character or all at once if you know the count, as the device offers them)
01-20-2011 06:18 AM