petebachant / acspy Goto Github PK
View Code? Open in Web Editor NEWPython package for working with ACS motion controllers.
License: MIT License
Python package for working with ACS motion controllers.
License: MIT License
Dear all,
I really like ACSpy. At the moment, the axis object object, part of the control module, has an enabled property and an enable and disable method. Wouldn't it be better to define a setter for the enabled property, and then if one use true or false run disable or enable!?
The acspy installed via the pip command is not the latest version in Code. This causes the problem ERROR 132 (unable to establish connection) when using openCommEthernetTCP. The main reason for this is the following difference in the two acspy.py files:
Figure 1
Figure 2
The address in Figure 1 is not encoded "10.0.0.100" to bytes type, which is the main reason for this error.
This could be an issue with the ACS C library, or maybe Python/ctypes
.
For example:
EthernetController
Simulator
Dear ACSpy team,
I hope you are doing great.
Using your package, I have been developing solutions interfacing between ACS controllers via Python.
I am wondering if it is possible to go deeper than reading position feedback (FPOS) to read count values from specific encoders and other raw data that are normally accessible via SpiiPlus but using Python.
I am looking fordward for your feedback.
Best regards,
René
Right now this is just started in a very basic sense. All functions should be implemented so the Controller
becomes the default interface.
See #17.
When I run the code pv.py in examples, Visual Code report that No module named 'acsc'.And when I use pip install acsc , it dont find this module either.Is there any promblem with the way of my usage?
Not that this is being used by anyone, but GPL may be too restrictive.
Some positioning systems (e.g. direct drive with missing hall sensors) need to calibrate the motor commutation. ACS controllers feature a auto commutate function.
This is supported by SPiiPlus C Library from version 2.5 on with the acsc_CommutExt function.
Description:
The function initiates motor commutation.
Syntax
Int acsc_CommutExt(HANDLE handle, int Axis, float Current, int Settle, int Slope, ACSC_WAITBLOCK *Wait)
Arguments:
Handle – Communication handle
Axis – The axis to perform commutation on. ACSC_AXIS_0 corresponds to axis0, ACSC_AXIS_1 –to axis1, etc.
Slope – Specifies the time it takes for the current to rise to the desired value, ACSC_NONE for default value.
Wait – Pointer to ACSC_WAITBLOCK structure.
If Wait is ACSC_SYNCHRONOUS, the function returns when the controller response is received. If Wait points to a valid ACSC_WAITBLOCK structure,
the function returns immediately. The calling thread must then call the acsc_WaitForAsyncCall function to retrieve the operation result.
If Wait is ACSC_IGNORE, the function returns immediately. In this case, the operation result is ignored by the library and cannot be retrieved to the
calling thread.
C Example use:
if(!acsc_CommutExt(Handle,// Communication handle
ACSC_AXIS_0, // Commuting axis 0
43, // Commutation current
ACS_NONE, // Use default settle
ACS_NONE, // Use default slope
ACSC_SYNCHRONOUS // Waiting call
)){
printf(“commutation error: %d\n”,acsc_GetLastError());
}
Can you add this?
For using/wrapping the COM library to a more Pythonic API. Should be able to integrate with the object oriented model and use interchangeably with the C library.
Hi, I was trying to help a colleague read the FPOS using your very useful ACSpy.
The function given in the read real example did not work for him ( at least on ACS 6.72 or ACS 7.0.0 ).
print(acsc.readReal(hc, acsc.NONE, "FPOS(0)"))
This returns 0.00 regardless of the value for FPOS(0).
I tried this instead , which does work :
print( acsc.readReal(hc, acsc.NONE, "FPOS", 0, 0 ) )
Also might be worth mentioning somewhere that on some PCs using openCommEthernetTCP requires an '.encode()' on the
IP address, but on others using .encode() does not work. This might be across different Python versions , not sure.
Hope this helps, my colleague uses your library quite a bit ( I use the C++ stuff from ACS myself so knew how to help him ).
Thanks.
For continuous integration.
Fixed major bug that was setting acceleration when setting jerk. Increment and upload to PyPI.
Maybe something like objects
or put these in the top level acspy
namespace. I think the latter would be better.
Try both 32 and 64 bit.
Dear Pete Bachant,
I am having a lot of fun with your work. Thanks for that 👍 . You should encode strings to "utf-8'.
Simple stated:
hcomm=acsc.openCommEthernetTCP('192.168.1.40', 701) --> return -1 in python 3.5
hcomm=acsc.openCommEthernetTCP('192.168.1.40'.encode('utf-8'), 701) --> return 0
All my python 2.7 code was therefore not python 3 compatible.
Ideally, I can supply strings from python 3 and they are encoded to "utf-8" in the library.
Best,
Rik
int acsc_ControllerReboot(HANDLE Handle, int Timeout)
If the function succeeds, the return value is non-zero.
If the function fails, the return value is zero.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.