12-30-2019 07:09 AM
Dear LabView community,
I have trouble programming a Newport SMC100 single-axis controller. I attached you my VI (Labview 2016, 64bit). The problem:
I check in the device manager for the right com port of the USB-to-Serial-Connector and enter the value before running the vi. Then I press 'Run' with activated light bulb function. For the first run of the program, I get permanent error -1073807298 from "tell controller statuts"-vi. If I stop and rerun the program, I get error -1073807240 from "port init"-vi.
I found some information on the internet and also in this community and already tried without success:
- upload drivers for USB-to-Serial driver (from Prolific) for Win10
- try to manually enter the com port settings in the device manager (baud rate, stop bits, flow control,..)
- try to use another USB-to-Serial connector (from ATEN)
- try different timeout values and also no value for "port init"-vi
- uploaded Labview 16 (only to most recent 2016 version, NOT yet to 2017,2018, etc..)
- used a modified Read/Write SubVI from this community (from here https://forums.ni.com/t5/LabVIEW/Newport-SMC-100-and-VISA-read-in-1073807298/td-p/3645947) for the "tell controller statuts"-vi.
If I use the original Newport SMC100 software (32 bit), I can control the stage without problems.
System properties:
- Win 10 Educational Version
- Labview 2016 Version 16.0f5 (64-bit)
- 8 GB RAM
I really have no more ideas and I'm looking forward to your ideas and tips. Thank you very much!
Best,
FinalDestillation
12-30-2019 02:45 PM
This is the problem that newbies run into when using drivers without understanding the basics.
Get the manual with commands for this instrument and use NI-MAX 's VISA Interactive Control.
.
12-30-2019 04:27 PM
Hi Final,
So I note that your original problem (or first problem) is the error -1073807298: "Could not perform operation because of I/O error"
I'd begin by noting that there's a help page linked to the post that you referenced (where I was surprised to see I was the person who responded, but anyway...). The link is here: Error -1073807298 When Using a Third-Party USB-Serial Adapter. Can you confirm that you've read through that link and tried the solution/method described there?
Note that setting the values in the device manager probably won't have any effect - they're presumably immediately overwritten by the settings specified in LabVIEW when it takes control of the COM port.
01-13-2020 06:38 AM - edited 01-13-2020 07:17 AM
Hi Cbutcher,
thank you very much for your answer. Obviously, changing the USB-to-Serial-Connector has changed the problem and moved it to the Newport-"Reset"-VI. It shows the -1073807339 error ("Timeout expired before operation completed"). Even adding a timeout of 2 s between the two VIs doesn't solve the problem. The Port-Init-VI works with this USB-to-Serial-connector fine (no error, correct resource detected). I can reproduce the old problem by changing the connector back.
Do you have an idea where the problem could be?
Thanks a lot and best regards,
Final Destillation
01-13-2020 07:44 AM
Addition to my last post:
I also tried the tips which you (@Cbutcher) gave me in the link, however I was unable to resolve the problem. But I could identify by modifying the property node that at least the timeout-node makes problems.
01-13-2020 07:13 PM
Hi Final,
I downloaded what appears to be the driver in question from this page: Newport SMC100 and took a closer look at the driver and the manual.
I have a few observations, and then perhaps you could clarify some questions:
You may be able to cobble this together by using a reliable serial-usb converter (there are several forum posts describing issues others have seen, particularly with cheap converters, although for me I've only seen working and completely dead, not partially failing...) and further increasing the timeout value passed to Init, but I'd suggest (if you have time, and not too many functions required) just rewriting the driver.
You could then use things like the TermChar (you'd need to specify \n, not \r), Configure VISA Serial Port, and create your own read/write VI which could correctly append the \r\n you needed and strip those from a response if desired...
If you do this, try to avoid things like the stacked sequence structures visible in the driver I downloaded, and look for built-in solutions (e.g. Clear Errors rather than unbundling an error, using " = constant" on the code and then switching the error wire in a specific case.
In LabVIEW 2019 you can directly wire the error wire to a case structure selector and specify individual (or ranges of) error codes, but even in older LabVIEW versions the = constant is unnecessary and wiring the code to the case selector would have been sufficient...
01-14-2020 09:45 AM
Hi Cbutcher,
thank you very much for your long answer.
I could solve the problem by moving my setup to another computer (without doing changes in the LabView-Files). I could not figure out where the source of the problem was. If someone else might have the problem also: I just got answer from the Newport support that their NI VISA drivers are (indeed..) old and they recommend to use and implement the driver .dll into labview. They can be found in:
C:\Windows\Microsoft.NET\assembly\GAC_32\Newport.SMC100.CommandInterface
or, if 64 bit is used
C:\Windows\Microsoft.NET\assembly\GAC_64\Newport.SMC100.CommandInterface
A short example can be found in C:\Newport\Motion Control\SMC100\LabView\Source code
Thank you very much again!