Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

digital input using flexmotion dll through VB

hi

i am using VB6 to call digital input functions in flexmotion5.0, i am using a NI PCI7344 motion control card.

i am having problems writing the code to read the port and bit of my choice. especially setting the 'port' and 'portData' variables in the flex_read_port_rtn function. are these integers or hex numbers? &H1 or 1?

could someone please forward me a snippet of VB code which reads specified digital inputs so i could have a look at it and see how to implement this function.

cheers in advance

daniel
dsmolATcyllen.uwa.edu.au
0 Kudos
Message 1 of 3
(3,050 Views)
Hello,

'port' is an integer parameter referring to the general-purpose I/O port (1, 2, 3, or 4) or RTSI software port (9) to be read.
'portData' also is an integer parameter that returns the bitmap of the logical state of the I/O 'port' (i.e. 0 would mean that all lines are FALSE and 255 would mean that all 8 lines are TRUE)
See the following example for a demonstration of this in Visual Basic.
Hope this helps!

Regards,

Yusuf C.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(3,050 Views)
thanks for that Yusuf,

the example given doesnt really give any clues to the read function. ive included my code which ive writen and cant get to work. im waiting for some VB code to go back on line which will hopefully demonstrate the correct use of this function. "Reading from and writing to the DIO ports on a FlexMotion Controller".

cheers for your help
daniel
0 Kudos
Message 3 of 3
(3,050 Views)