List Info

Thread: Input for MatPLC




Input for MatPLC
country flaguser name
Indonesia
2007-10-04 23:35:04
hallo MatPLC developer

i have question about MatPLC, how can MatPLC read
input from parallel port and then can display in
computere PC.
 when i read about chaser, vitrine and matplc.conf 
and kbd module, input only coming from keyboard. and
now i want input from another by parallel port.

thank you

rizki.



       
____________________________________________________________
________________________
Building a website is a piece of cake. Yahoo! Small Business
gives you all the tools to get online.
http://smal
lbusiness.yahoo.com/webhosting 

------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: Input for MatPLC
country flaguser name
Portugal
2007-10-10 03:39:07
On Friday 05 October 2007 05:35, dian rizki wrote:
> hallo MatPLC developer
>
> i have question about MatPLC, how can MatPLC read
> input from parallel port and then can display in
> computere PC.
>  when i read about chaser, vitrine and matplc.conf
> and kbd module, input only coming from keyboard. and
> now i want input from another by parallel port.
>
> thank you
>
> rizki.
>
>



 The parallel port may be used for both input and output
simultaneously.

 For detailed info, please have a look at the sample
configuration of the 
basic_parport demo, which I have copied below.
 If you want to control the direction of scrolling through
some external 
inputs, you would merely need to add config for some inputs.
Something 
similar to the following to the very end of the file (i.e.
under the 
[parport] section):
map in C.0 left
map in C.1 right


 You would also need to change the following lines from
[PLC]
point left	"<- (key L)" Kbd
point right	"-> (key R)" Kbd
point quit	"quit (key Q)" Kbd

 to
[PLC]
point left	"<- (key L)" parport
point right	"-> (key R)" parport
point quit	"quit (key Q)" Kbd


 to give the parport module write access on the 'left' and
'right' points.


   Cheers,

		Mario.


------------------------------------------

#  Digital I/O available on the parallel port
#
#  Bitmap:
#  Data In/Out     D0-D7   8 LS TTL outputs/inputs (pins 2-9
respectively)
#  Status In       S3-S7   5 LS TTL inputs (pins
15/13/12/10/11 respectively)
#  Control In/Out  C0-C3   4 TTL Open Collector
outputs/inputs (pins 
#  1/14/16/17)
#
#  NOTE: Some of the S and C bits are inverted by the
parallel port hardware.
#        We re-invert all these bits so that this library
presents a coherent
#        positive logic interface.
#
#  NOTE: C0-C3 are usually used solely as outputs, but since
they are
#        open collector, they can be put into high impedance
state by writing
#        1 to every output. In this state, these lines may
be used as inputs!
#        That is why we inhibit any writes to this register
while it is
#        in input mode.
#	 Note that not all PC hardware allows reading the true
input value
#	 of this register when the outputs are set to high
impedance, so this
#        may not always work.
#        Note that this may also not work if the access to
the parallel port
#        is made through the kernel, instead of going direct
by reading io
#        ports
#        It is guaranteed not to work on a PC style hardware
and if using
#        kernel
#        access because the kernel pc parallel port driver
does not support
#        reading the true inputs of this register. It merely
hands out a copy
#        of the most recent write.
#


# define the direction {in | out} the D register should use
Ddir = out

# define the direction {in | out} the C register should use
Cdir = in

# The S register can only be used as input!

# NOTE: If the direction of a register is not explicitly
specified, it
#       will be inferred from the direction of the first
point mapping
#       in which it appears.


# node format
# map [inv | invert] {in | out} <io_addr> <matplc
point>
#
#  inv    -> invert the value being read from/writen to
physical IO
#  invert -> invert the value being read from/writen to
physical IO
#
#  in  -> copy the state of the parallel port register to
the matplc point
#  out -> copy the state of the matplc point to the
parallel port register
#
#  <io_addr>  : address of physical IO. For the
parallel port, use the syntax
#               <register>.<bit>
#  <register> : one of C, D or S
#  <bit>      : [0..7] for D
#               [0..3] for C
#               [0..4] for S
#
# NOTE: all bits of the same register must use the same
direction (in or out)



# Note: I am using leds that light up when the output is
low, so I choose
#       to invert the matplc points before copying to the
parallel port.
#       That way, the led will light up when the matplc
point is set (=1)

map inv out D.0 L1
map inv out D.1 L2
map inv out D.2 L3
map inv out D.3 L4
map inv out D.4 L1
map inv out D.5 L2
map inv out D.6 L3
map inv out D.7 L4

 




------------------------------------------------------------
-------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and
a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )