I'm trying to patch together a motor control system using python and ctypes and one of the things I need to do is take an text input and convert it to an 8-bit signed integer.
Below is the documentation for the function I'm trying to call. The text that should be input into the program is 'EPOS2'

The data type definition is as shown below (note that 'char*' equates to an 8-bit signed integer)

So How do I convert 'EPOS2' to a value between -128 and 127?
Ultimately what I'm trying to do is something like this:
import ctypes #import the module
lib=ctypes.WinDLL(example.dll) #load the dll
VCS_OpenDevice=lib['VCS_OpenDevice'] #pull out the function
#per the parameters below, each input is expecting (as i understand it)
#an 8-bit signed integer (or pointer to an array of 8 bit signed integers,
#not sure how to implement that)
VCS_OpenDevice.argtypes=[ctypes.c_int8, ctypes.c_int8, ctypes.c_int8, ctypes.c_int8]
#create parameters for my inputs
DeviceName ='EPOS2'
ProtocolStackName = 'MAXON SERIAL V2'
InterfaceName = 'USB'
PortName = 'USB0'
#convert strings to signed 8-bit integers (or pointers to an array of signed 8-bit integers)
#code goes here
#code goes here
#code goes here
#print the function with my new converted input parameters
print VCS_OpenDevice(DeviceName,ProtocolStackName,InterfaceName,PortName)
char, it's achar*. Which is, technically speaking, a pointer to achar, but is generally used do denote an array ofcharsterminated with the Null Byte - or a String. How are you trying to call this function? Example code will let us know what exactly is missing.ctypeshere? Are you calling another library and want to use it to do that, or can you literally just emulate a structure using thestructmodule?