03-06-2006 03:40 AM
03-06-2006 08:46 PM
03-06-2006 08:50 PM
03-07-2006 12:31 AM
You are busy on device driver level with your portmon program. That is something rather low level. As you can get from the names of the device driver IOCTLs they are all abut parameters for the serial port. The serial port has to be initialized properly in order to communicate with your device.
@GeeWhiz wrote:
Hi Warren; With regard to the "Get" and Set Stuff" reference; When I send a cmmd to the device, the port monitor showsthe following typical statements:IOCTL_SERIAL_GET BAUD RATEIOCTL_SERIAL_GET LINE CONTROLIOCTL_SERIAL-GET CHARSIOCTL_SERIAL_GET HANDFLOWIOCTL_SERIAL_SET BAUD RATEIOCTL_SERIAL_SET RTSAnd so forth till a "IRP_MJ_WRITE Request is made.Since Hyperterminal did not send these request and the device was responding, I was thinking that the request could possibly be left off for simplification. I haven't had time to make the changes you recommended but I will. I appreciate your help and patience.
03-07-2006 10:40 AM
@GeeWhiz wrote:
Hi Warren; With regard to the "Get" and Set Stuff" reference; When I send a cmmd to the device, the port monitor showsthe following typical statements:IOCTL_SERIAL_GET BAUD RATEIOCTL_SERIAL_GET LINE CONTROLIOCTL_SERIAL-GET CHARSIOCTL_SERIAL_GET HANDFLOWIOCTL_SERIAL_SET BAUD RATEIOCTL_SERIAL_SET RTSAnd so forth till a "IRP_MJ_WRITE Request is made.Since Hyperterminal did not send these request and the device was responding, I was thinking that the request could possibly be left off for simplification. I haven't had time to make the changes you recommended but I will. I appreciate your help and patience.
The VI is doing exactly what you have programmed, every time you click the run button it is configuring the serial port and then sending the string. Turn on execution highlighting and watch it. The VI won't skip over the Configure step the second time you run it if you have not built the VI such that it keeps track of how many times you run it and knows to skip the Configure step for later runs.
The stepper motor controller is an ALLMotion EZ17.
03-07-2006 06:59 PM
I am now successfully using the "Basic Serial Write and Read VI" from NI to command the motor to position. This was accomplished by just terminating the String to Write properly with a "\r" which is consistent with your recommendations.The vi has the "VISA Configure Serial Port" function followed by the "VISA Write" and "String to Write" (both inside Case Structure). There are no "While Loops" in the VI. I still get the error message -1073807298, Hex 0xBFFF003E, when I run the VI but the device responds properly to positioning commands. However, commands that asks for responses are not read. An example is /1?8\r is a request to return the stepper motor position. While I get a response from Hyperterminal with this command, I dont see a response with LabView.
I turned on the execution highlighting and stepped the through the vi. The error message -1073807298 shows up on the output ot the VISA Write function and is carried all the way through.
Driving the stepper motor is part of a bigger project in which I will be driving LED's, taking analog voltages, and performing analyses of data. If I can figure out how to post an image, I will.
03-08-2006 10:20 AM - edited 03-08-2006 10:20 AM
Good.
The message associated with that error number is "-1073807298 VISA: (Hex 0xBFFF003E) Could not perform operation because of I/O error."
At this point I don't know why you are getting it.
Usually to successfully read responses you need to customize the reading routine to the message format which you are expecting. That is why I pointed out in my previous message that the last character of every message that the EZ17 will send to the PC is terminated by a linefeed character. That makes reading easy. You just tell VISA to hold all characters until it gets a linefeed and then, when it finally does get one, return all characters it has collected up to and including the linefeed. See if the attached VI set (LV v7.1.1) will allow you to send commands and read responses.
Not the easiest process but here how you can post an image.
- Capture an image - If you are using a PC, pressing the "PrtScn" (Print Screen) key (usually near F12 along the top of the keyboard) will capture a bitmap to the clipboard of the entire Windows desktop. If you hold down the "Alt" key when pressing PrtScn, then you will capture a bitmap of the current active window.
- Open an image editing program and past the clipboard image into it. Crop it as desired.
- Save the image to a JPG, GIF or (my favorite) PNG file.
- When posting to this forum, browse to the image file and add it as an attachment.
You can stop here if you do not want to have a thumbnail version of the image appear in the posting.- If you want to include a thumbnail of the image in the posting, then finish editing the text of the posting and get the posting spell-checked and looking like you want it to look without the thumbnail image (note that due to a bug in the forum system software, if you choose to preview the message then you will need to re-add your image attachment that was added in the previous step)
- Submit the Post
- View the submitted post and select the now-visible hyperlink to the now-attached image and copy the hyperlink to the clipboard.
- Within 5(?) minutes of submitting the posting, choose to re-edit the post (if you wait too long, you will lose the option to re-edit).
- Click in the message edit window where you want the image to appear.
- Click on the "Insert an Image" button above the edit window and paste the hyperlink to the image into the box that appears.
- Resubmit the post. The image should be visible as a thumbnail.
Feel free to post the VI(s) instead of images if that is easier for you; it can be easier for those of us trying to do the debugging from afar...
Message Edited by Warren Massey on 03-08-2006 08:20 AM
03-15-2006 02:20 PM
03-15-2006 02:51 PM
@GeeWhiz wrote:
Hi Warren; Thanks for sending me the vi's to try. I have been trying to run the "VISA Serial Send Message" and the "VISA Send Commands and Check Responses" vi's. I have not got any response from the stepper motor. I am still getting the same error responses that I have previously posted. (the -1073807298) Should the "Send Message" sub-vi run by itself? When I run it, I see on the port monitor the first command character intermingled with "Get Com Status" and "Flush Buffer". Hold on! I just discovered that is the case when the "Intercharacter Delay" is set to 1 ms. and the retry count is set to 1. When I set the "Intercharacter Delay" back to zero with the retry at "1", Portmon does see the entire command set, as entered, but the stepper motor does not respond. Is that because with this sub-vi there is no way to set Baud Rate, Stop Bits etc. It does allow setting the comm port.
The 138kb zip file I posted a couple of messages back has "VISA Send Commands & Check Responses.vi" as a top-level VI. That is the file you should be running. It is a complete demonstration communication program. On its block diagram it does have a way for you to specify the comm port as well as the baud rate and so forth off to the left side.
The "Send Message" vi should not normally be run by itself. But, with that said, if you don't do anything to close the serial port then you can configure a port with one VI and then subsequently run another VI like Send Message to transmit information out the port, but the usual way is to build it all into a program that handles it all in an ordered sequence like the program I provided.
03-16-2006 06:44 PM