# How to use PyVisa or maybe sockets in Ignition to talk to VISA/SCPI device?

**URL:** <https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634>\
**Category:** Ignition\
**Tags:** python, ignition79, scripting\
**Created:** [November 7, 2018, 6:38pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634 "2018-11-07T18:38:01Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![ssridharan](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@ssridharan](https://forum.inductiveautomation.com/u/ssridharan)\
**Post date:** [December 5, 2019, 10:32pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/21 "2019-12-05T22:32:02Z")

</div>

> [@ghuck](#):
>
> ust the use the Ignition TCP Driver found at the bottom of the add devices page. It’s a persistent connection. Just set the driver Message Delimter type to ASCII, the

@ghuck @cmaynes could one you post some examples of scripts you used for Raw Socket connection with SCPI commands ?

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [December 6, 2019, 3:59am UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/22 "2019-12-06T03:59:41Z")

</div>

This thread contains the code that I use to access all of my SCPI devices. It uses the OPC server to pass data back and forth to the SCPI device, so speed is s little limited, but works for anything that does not require pushing the speed of the end device.  
Most of the code has to be put onto the gateway, and it uses one UDT to manage the connection.  
[http://forum.inductiveautomation.com/t/scpi/23357/5](http://forum.inductiveautomation.com/t/scpi/23357/5)

---

<div class="post-metadata">

**Author:** ![mrutten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mrutten](https://forum.inductiveautomation.com/u/mrutten)\
**Post date:** [December 15, 2020, 2:03pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/23 "2020-12-15T14:03:03Z")

</div>

ghuck, The link is gone. I am very interested to find out how you did this. Any way I can get to see your code?

Thank you.

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [December 15, 2020, 3:49pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/24 "2020-12-15T15:49:33Z")

</div>

Are solution never used PyVisa, are VISA instruments all use SCPI so we wrote a client side python driver, which sends and receives SCPI data though the OPC server using a raw TCP/IP device connection. But are solution only works with SCPI enabled instruments.

There is a lot of code to post, and probably why the link no longer works. But if your still interested in going down the route, I can find a better way to post that here. It involves three gateway tag change scripts. one to generate the outgoing SCPI instructions, one to monitor and parse the returning data, and one to keep things running.

---

<div class="post-metadata">

**Author:** ![mrutten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mrutten](https://forum.inductiveautomation.com/u/mrutten)\
**Post date:** [January 5, 2021, 3:22pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/25 "2021-01-05T15:22:12Z")

</div>

ghuck,

Yes I am very interested. It would be nice if there was a configurable SCPI OPC-UA server, but I can not find any information on that. So I would like to see how you did it and see if I can resolve my issue with looking at your code. I am also connecting to a Keysight DAQ970A instrument.

Thanks.

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [January 30, 2021, 11:16pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/26 "2021-01-30T23:16:47Z")

</div>

mrutten;

All of my code bits can be found in this link;  
[http://forum.inductiveautomation.com/t/scpi/23357/5](http://forum.inductiveautomation.com/t/scpi/23357/5)

---

<div class="post-metadata">

**Author:** ![chapari](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@chapari](https://forum.inductiveautomation.com/u/chapari)\
**Post date:** [May 31, 2022, 5:21pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/27 "2022-05-31T17:21:22Z")

</div>

Hi ghuck,

The link isn’t available anymore. Would you mind sharing your code one more time ?

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [May 31, 2022, 10:03pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/28 "2022-05-31T22:03:45Z")

</div>

Strange the link [http://forum.inductiveautomation.com/t/scpi/23357/5](http://forum.inductiveautomation.com/t/scpi/23357/5) still works for me. If you not in a hurry I’ll put it out the Ignition Exchange but I won’t be able to get to it until Sunday.

---

<div class="post-metadata">

**Author:** ![mrutten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mrutten](https://forum.inductiveautomation.com/u/mrutten)\
**Post date:** [June 1, 2022, 11:50am UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/29 "2022-06-01T11:50:17Z")

</div>

This is what I get when going to that link

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 1, 2022, 12:14pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/30 "2022-06-01T12:14:43Z")

</div>

I can't see it either:

> Oops! That page doesn’t exist or is private.

That might be admin action based on a copyright complaint. Examine your post to verify you haven't cut-n-pasted somebody else's code.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 1, 2022, 12:55pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/31 "2022-06-01T12:55:22Z")

</div>

> [@pturmel](#):
>
> That might be admin action based on a copyright complaint. Examine your post to verify you haven’t cut-n-pasted somebody else’s code.

He's linking to a message in a private exchange between him and Kyle Chase. (I think?)

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [June 1, 2022, 3:00pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/32 "2022-06-01T15:00:04Z")

</div>

I’ll just put it out on the Ignition Exchange next weekend, it will be more accessible, and easier to use. Now that I know the code is very stable, and I have used it many times on lots of systems that have SCPI interfaces.

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [June 7, 2022, 4:37pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/33 "2022-06-07T16:37:12Z")

</div>

I put the full set of scripts out on the Ignition exchange last night. It will take a few days (usually) before IA vets everything that I put into that downloadable resource. So just do a search for SCPI in a few days and it should be there.

---

<div class="post-metadata">

**Author:** ![mrutten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mrutten](https://forum.inductiveautomation.com/u/mrutten)\
**Post date:** [June 7, 2022, 4:55pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/34 "2022-06-07T16:55:18Z")

</div>

Thank you so much. I appreciate your help.

---

<div class="post-metadata">

**Author:** ![mrutten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mrutten](https://forum.inductiveautomation.com/u/mrutten)\
**Post date:** [August 12, 2022, 4:47pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/35 "2022-08-12T16:47:00Z")

</div>

@ghuck, were you able to upload your script? I still can not find it?

Marcel

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [August 12, 2022, 6:20pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/36 "2022-08-12T18:20:13Z")

</div>

@mrutten I’m assuming it’s this? [Ignition Exchange | Inductive Automation](https://www.inductiveautomation.com/exchange/2303/overview)

---

<div class="post-metadata">

**Author:** ![ghuck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ghuck/32/8337_2.png) [@ghuck](https://forum.inductiveautomation.com/u/ghuck)\
**Post date:** [August 13, 2022, 7:32pm UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/37 "2022-08-13T19:32:29Z")

</div>

Yes. Just follow the readme instructions in the download.

---

<div class="post-metadata">

**Author:** ![mrutten](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mrutten](https://forum.inductiveautomation.com/u/mrutten)\
**Post date:** [August 15, 2022, 11:28am UTC](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634/38 "2022-08-15T11:28:59Z")

</div>

Thank you @Matthew.gaitan and @ghuck.  
That was the link I was looking for.

[Previous page](https://forum.inductiveautomation.com/t/how-to-use-pyvisa-or-maybe-sockets-in-ignition-to-talk-to-visa-scpi-device/20634.md?page=1)
