03-27-2023 02:26 PM
Hi All,
I am trying to initialize Pacific Power AC Source using NI VISA, communication is TCP using USB to computer, if USB is disturbed Then I loose connection with Power Supply, I create a new session every time during initialization
Session session = (MessageBasedSession)resourceManager.Open(resourceName);
// session.Add(resourceName, (MessageBasedSession)session);
return (MessageBasedSession)session;
But I end up getting Parsing error as below -
Please can someone suggest a idea or thoughts to resolve.
Thanks.
Solved! Go to Solution.
03-28-2023 05:42 AM
Hello.
> communication is TCP using USB to computer
The address starting with "TCPIP" is the VISA address when connecting via LAN.
If it's USB, it starts with the string "USB".
See link below.
https://www.ni.com/docs/ja-JP/bundle/ni-visa/page/ni-visa/visaresourcesyntaxandexamples.html
03-28-2023 04:24 PM
I use Virtual LAN but USB 2.0 A to B Cable.
I have had no problem in initializing, also as shown when connected to web page of device, Address string is embedded, can't change.
Problem occurs when usb is interrupted, want to make application robust. Any suggestion.
Also, I have checked using USB as a string in place of TCPIP but I get same error.
Thanks,
Riddhi
03-28-2023 06:53 PM
Try changing the host name in your VISA address to your IP address.
"TCPIP::x.x.x.x::inst0::INSTR" or "TCPIP::x.x.x.x::INSTR"
03-29-2023 07:14 AM
@RiddhiShah717 wrote:
Problem occurs when usb is interrupted, want to make application robust. Any suggestion.
I just avoid USB as much as possible. If available, use direct LAN. But if you must use USB, go into the Windows Device Manager and into the properties for every USB hub and disable the option for Windows to "save energy" by randomly turning off the USB hub.
03-29-2023 09:45 AM
Yes, I had tried using TCPIP0::X.X.X.X::inst0::INSTR, but I get same error when interrupted, Does this string should end in "\r" or "\n"? Any other suggestions?
Thanks
03-29-2023 09:47 AM
Verified in Device Manger, USB that I use don't see any option for disabling to "save energy" but also what does this option would do for me, I would like to enable once interrupted. Problem exists.
03-29-2023 12:38 PM
@RiddhiShah717 wrote:
Verified in Device Manger, USB that I use don't see any option for disabling to "save energy" but also what does this option would do for me, I would like to enable once interrupted. Problem exists.
Disabling the option prevents the USB connection from being reset.
03-30-2023 12:19 PM
I don't see that option to disable in properties. Anything else, you could suggest any other idea would be great. As I am still stuck with the same issue.
04-04-2023 08:30 AM
The problem was solved, it was the Firmware of the Power Source it self, Major firmware was updated that resolved the issue for disconnecting of USB, and a *RST command increased it's delay time during opening of session, that helped when initializing to reset hardware from 4sec to 5sec, minimum requirement is 4 sec.
Thanks for responses.