Hello Guest it is April 26, 2024, 08:46:56 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TPS

931
do you have some more Information about the  Cards and the plugin?
there must be way to get Access to These in- Outputs.
because, if the plugin get Access there must be a way to get access.
 the plugin must reflect These IOs to somewhere,i think into modbus IO aeria, like all the other
Motion Controller do it.

932
example to write UserLed's to a port

Code: [Select]
'example to write UserLed 2201-2208 to port
'Our port address
PortAddr = 1016 '0x3f8
PortData = 0

If (GetUserled(2201) = 1) Then
  PortData = PortDate + 1
End If
If (GetUserled(2202) = 1) Then
  PortData = PortDate + 2
End If
If (GetUserled(2203) = 1) Then
  PortData = PortDate + 4
End If
If (GetUserled(2204) = 1) Then
  PortData = PortDate + 8
End If
If (GetUserled(2205) = 1) Then
  PortData = PortDate + 16
End If
If (GetUserled(2206) = 1) Then
  PortData = PortDate + 32
End If
If (GetUserled(2207) = 1) Then
  PortData = PortDate + 64
End If
If (GetUserled(2208) = 1) Then
  PortData = PortDate + 128
End If

PortData = PutPortByte(PortAddr, PortData)


933
so if you are able to Access the Card via the regular port/pin Setup, they should be also be red/writeable via

GetPortByte(PortAddr)

and

PutPortByte(PortAddr)
as shown in this example i did
Code: [Select]
  ' Our port address
  PortAddr = 1016 ' 0x3f8
  ' Read data register of parallel port at 0x3f8
  PortData = GetPortByte(PortAddr)
  ' write the data to OEMLed's
  SetUserLed(2001,PortData And &H01)
  SetUserLed(2002,PortData And &H02)
  SetUserLed(2003,PortData And &H04)
  SetUserLed(2004,PortData And &H08)
  SetUserLed(2005,PortData And &H10)
  SetUserLed(2006,PortData And &H20)
  SetUserLed(2007,PortData And &H40)
  SetUserLed(2008,PortData And &H80)

you have to out in there the same port adress as in Mach3 setup   

934
i think the Problem is that the variable Id is not specified

try a

Id = 0 at the begin of code

935
just tested here in the VB Scripter window. working here.

936
ok but you to figure out first, witch port Adresses these Card are using.
my sample is only for 8 bit's so they must use more adresses.

do you know the type of the Cards?

937
i think macropump script can do this Job.
i dont know witch contec card's you have, but if they are port based something like this will read the data
and store it in UserLed's

Code: [Select]
  ' Our port address
  PortAddr = 1016 ' 0x3f8
  ' Read data register of parallel port at 0x3f8
  PortData = GetPortByte(PortAddr)
  ' write the data to OEMLed's
  SetUserLed(2001,PortData And &H01)
  SetUserLed(2002,PortData And &H02)
  SetUserLed(2003,PortData And &H04)
  SetUserLed(2004,PortData And &H08)
  SetUserLed(2005,PortData And &H10)
  SetUserLed(2006,PortData And &H20)
  SetUserLed(2007,PortData And &H40)
  SetUserLed(2008,PortData And &H80)
   

938
did a Little bit of searching about These Contec PCI i/o cards , they have their own dll files to read the Inputs.

maybe the best way would be to run a Background thread witch reads the data and puts it into OEMLed's, then
you can read those in every script.

939
for direct Access via VB script you have to get familar with API functions by using inpout32.dll

Code: [Select]
' API Funktionen der InpOut32.dll
Private Declare Function Inp Lib "inpout32.dll" Alias "Inp32" ( _
  ByVal PortAdress As Integer) As Integer


there are many examples avaliable on the Internet.

940
General Mach Discussion / Re: Setup and Control issue
« on: May 06, 2020, 03:22:07 PM »
pls post your Profile XML. to have a look.