Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VISA-based RS232 communication with Codesys program for Compax3

For a project involving a Compax3 motor system, I am working on both a Codesys control program (which takes I0-I7 inputs to execute different movements) as well as a Python script using PyVISA (with pyvisa-py as the backend, since I had issues using ni-visa) to send/receive communications to/from Compax3 (after it had downloaded the Codesys program) via RS232 to both get and change the current input, output, and recipe array table values.

While both the Codesys program and Python script are not fully debugged, a simple test shows them not working in tandem as expected:

- Codesys program is linked and downloaded to Compax3 in Windows machine

- Codesys program is tested in Compax3. Changing inputs in optimization window affects motor activity (ex: setting I3 to 1 turns on the motor).

- Ubuntu VM is opened and script is run in terminal. Compax3 device is properly detected and writing/reading I0-I6 shows that values are accurately and durably changed, even when VM is rebooted.

- Writing new values to I0-I6 inputs does not affect motor activity at all, unlike earlier tests in the Compax3 optimization window.

Why does this (not) happen? Is this a VM issue, a programming issue, or can alternate forms of RS232 communication besides the optimization window in Compax3 itself not be used in conjunction with Codesys programs (which Compax3 calls IEC 61131-3 programs) for some reason?

This involves a few disparate programs and libraries, so let me know if there is a better internet forum to post this on.

0 Kudos
Message 1 of 2
(1,257 Views)

Hi there,

 

Not sure if this NI forum will provide much help for you.  You're using a Parker Hannifin motor, might have better luck at the Parker forums.

 

https://community.parker.com/p/forums

 

BR

John

0 Kudos
Message 2 of 2
(1,215 Views)