08-16-2012 09:36 PM
There is nothing obviously wrong with your VI. It is pretty basic.
We can't comment on your Write string because it is saved as an empty string control in your VI. When you type in your command to the control, do you need to include a termination character like a carriage return or line feed? When it works in Hyperterminal are you hitting the enter key?
08-17-2012 03:34 AM
Hi Csimpson.
I think the problem is caused, since you both are using VISA Open and VISA Configure Serial Port. You can only use one of them.
We have a NI Example that shows how to read and write using a serial connection. Navigate to Help => Find Examples, and search for "Basic Serial Write and Read.vi". This will show you how to use the VISA Configure Serial Port.
I hope this information is helpful.
Have a great day.
08-17-2012 09:29 AM
@A.E.P wrote:
Hi Csimpson.
I think the problem is caused, since you both are using VISA Open and VISA Configure Serial Port. You can only use one of them.
We have a NI Example that shows how to read and write using a serial connection. Navigate to Help => Find Examples, and search for "Basic Serial Write and Read.vi". This will show you how to use the VISA Configure Serial Port.
I hope this information is helpful.
Have a great day.
That's simply not true. There is no problem at all in using a VISA Open. It is not required since VISA will automatically create a session but it will not cause any problems if you explicitly call it.
I think Ravens Fan is correct. You probably are not sending a termination character. Even if you enter a \r or \n, it will not be sent correctly since the string control is not set for '\' Codes Display.
08-17-2012 03:08 PM
Thanks Dennis,
I believe you may be correct. I had to create Termination character settings when I put set up NSTRUCT. How/where do I put in termination characters into my code?
08-17-2012 03:10 PM
And yes, in HyperTerminal, I do use the enter key. But I had configured termination character settings with HyperTerminal prior to using it. I just can't find where to do so in LabView.
08-17-2012 03:24 PM
Right click on your string constant and get it to display \codes.
If you want it to be a carriage return, then type \r. If you want the line feed character, type \n.
DO NOT DO THIS WITH THE CONSTANT IN NORMAL DISPLAY. If you do, then you wind up sending a literal backslash character and a literal character "r" or "n".
08-17-2012 03:25 PM
I generally format my commend strings explicitly. If you need termination character I include it in the command string itself. You could also set the end mode for writes using the VISA properties.
08-23-2012 04:45 PM
It works great!... THANK YOU SO MUCH. I never would have figured all of that out myself.
09-10-2012 04:58 PM
Just jumping into the bandwagon of VISA configure vs VISA open. Like it has been pointed out, I never used VISA OPEN vi (actually never knew it existed because I always referred to the Serial palette 🙂 ) But, there was a weird error I noticed today in that my device said "Communication error" which pointed to either the resource was not open properly or something else went wrong. (My application has to run 24 hours 7 days a week) . But now, I have VISA configure followed by VISA OPEN before entering the While loop. Any preference in order VISA Configure --> VISA open or VISA open --> VISA configure or it doesn't matter?
Thanks!
09-10-2012 05:29 PM
@VeeJay wrote:
But now, I have VISA configure followed by VISA OPEN before entering the While loop. Any preference in order VISA Configure --> VISA open or VISA open --> VISA configure or it doesn't matter?
I would Open and then Configure. That way you know for sure what you have. I wouldn't want to risk the Open unknowingly change a setting on me.