List Info

Thread: allocation of io_addr_t




allocation of io_addr_t
country flaguser name
Italy
2007-06-09 06:44:08
Hi,

I'm still fighting with my 1Wire IO driver
I need to clarify some stuff on IO module function lib

If I well understand the process this is what happens:

Function |io_hw_parse_io_addr(io_addr_t *io_addr, const char
*addr_stri, 
dir_t dir, int pt_len) will save in different io_addr
variable the 
physical location of each IO read from config file

So io_addr is some kind of array (length is equal to total
IO count) , 
right?

After this initial process
Any time PLC engine need to access an IO, PLC engine pass
the io_addr of 
the IO as defined by the above function to the io_hw_write
and/or io_hw_read

Thanks
Ciao
Marco

|

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: allocation of io_addr_t
country flaguser name
Portugal
2007-06-13 10:06:37
On Saturday 09 June 2007 12:44, marco tozzini wrote:
> Hi,
>
> I'm still fighting with my 1Wire IO driver
> I need to clarify some stuff on IO module function lib
>
> If I well understand the process this is what happens:
>
> Function |io_hw_parse_io_addr(io_addr_t *io_addr, const
char *addr_stri,
> dir_t dir, int pt_len) will save in different io_addr
variable the
> physical location of each IO read from config file
>
> So io_addr is some kind of array (length is equal to
total IO count) ,
> right?

 Yes.

>
> After this initial process
> Any time PLC engine need to access an IO, PLC engine
pass the io_addr of
> the IO as defined by the above function to the
io_hw_write and/or
> io_hw_read
>

 Yes.
 Actually, this is done cyclically, but your interpretation
is still correct.


 Cheers,

		Mario.

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: allocation of io_addr_t
user name
2007-06-14 02:07:39
hi,
I'm new at this forum 

I just want to ask you about how to received an input data
from the real 
world using the parport module? 

I already changed the matplc.conf, especially the parport
section
Ddir = in
Cdir = in 

map inv in  D.0 L5
map inv in  D.1 L6
map inv in  D.2 L7
map inv in  D.3 L8
map     out D.4 L1
map     out D.5 L2
map     out D.6 L3
map     out D.7 L4 

as you know, I already declared the Matplc points 


thanks 

 

WELCOME TO THE WORLD OF TODAY 

"YESTERDAY ONLY A HISTORY,
TOMORROW ONLY A MYSTERY, AND
TODAY IS A GIFT" 


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


parport problem, VERY NEED HELP, PLEASE!!!
user name
2007-06-14 02:09:00
> hi,
> I'm new at this forum  
> 
> I just want to ask you about how to received an input
data from the real 
> world using the parport module?  
> 
> I already changed the matplc.conf, especially the
parport section
> Ddir = in
> Cdir = in  
> 
> map inv in  D.0 L5
> map inv in  D.1 L6
> map inv in  D.2 L7
> map inv in  D.3 L8
> map     out D.4 L1
> map     out D.5 L2
> map     out D.6 L3
> map     out D.7 L4  
> 
> as you know, I already declared the Matplc points  
> 
> 
> thanks  
> 
sori for the mistakes before, I sent the wrong subject
>  
> 
> WELCOME TO THE WORLD OF TODAY  
> 
> "YESTERDAY ONLY A HISTORY,
> TOMORROW ONLY A MYSTERY, AND
> TODAY IS A GIFT"  
> 
 


WELCOME TO THE WORLD OF TODAY 

"YESTERDAY ONLY A HISTORY,
TOMORROW ONLY A MYSTERY, AND
TODAY IS A GIFT" 


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: parport problem, VERY NEED HELP, PLEASE!!!
country flaguser name
Portugal
2007-06-14 04:54:57



 The parallel port has several groups of pins, namely: 
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)

 D pins may be either input or output, but must ALL work in
the same 
direction. If one D pin is input, all other D pins must also
be input. If one 
D pin is output, all other D pins must also be output.
(This is your error in the config file you sent).

S pins are always output.

C pins may are usually output. However, since they are open
colector outputs, 
it is usually possible to work them as inputs (it really
depends on your 
parallel port hardware on your motherboard). With this group
of pins (C), it 
is possible (I think) to have some input, and some output
pins 
simultaneously.




 Cheers,

		Mario.

On Thursday 14 June 2007 08:09, putu.narasanthastudent.sgu.ac.id wrote:
> > hi,
> > I'm new at this forum
> >
> > I just want to ask you about how to received an
input data from the real
> > world using the parport module?
> >
> > I already changed the matplc.conf, especially the
parport section
> > Ddir = in
> > Cdir = in
> >
> > map inv in  D.0 L5
> > map inv in  D.1 L6
> > map inv in  D.2 L7
> > map inv in  D.3 L8
> > map     out D.4 L1
> > map     out D.5 L2
> > map     out D.6 L3
> > map     out D.7 L4
> >
> > as you know, I already declared the Matplc points
> >
> >
> > thanks
>
> sori for the mistakes before, I sent the wrong subject
>
> > WELCOME TO THE WORLD OF TODAY
> >
> > "YESTERDAY ONLY A HISTORY,
> > TOMORROW ONLY A MYSTERY, AND
> > TODAY IS A GIFT"
>
> WELCOME TO THE WORLD OF TODAY
>
> "YESTERDAY ONLY A HISTORY,
> TOMORROW ONLY A MYSTERY, AND
> TODAY IS A GIFT"
>
>
>
------------------------------------------------------------
-------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
express and take
> control of your XML. No limits. Just data. Click to get
it now.
> http://sourcefor
ge.net/powerbar/db2/
> _______________________________________________
> MAT-devel mailing list
> MAT-devellists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mat-devel


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: parport problem, VERY NEED HELP, PLEASE!!!
user name
2007-06-16 05:21:31
If you mean paraport as LPT port, you should open it like this.

ppdev program example
#include <stdio.h>

#include <sys/types.h>
#include <sys/stat.h>

#include <stdlib.h>

#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/ppdev.h>
#include <linux/parport.h&gt;

main() {
int fd;
unsigned char byte;
int loop, rc, dir;

fd = open(";/dev/parport0", O_RDONLY);
if (fd == -1) {
printf(&quot;open errorn&quot;);
exit(1);
}

rc = ioctl(fd, PPCLAIM);
if (rc != 0) {
printf(&quot;ppclaim errorn&quot;);
close(fd); exit(1);
}

dir = -1; /* 0=foward, non-zero=reverse */
rc = ioctl(fd, PPDATADIR, &dir);
if (rc != 0) {
printf(&quot;ppdatadir errorn&quot;);
ioctl(fd, PPRELEASE);
close(fd);
return 1;
} else {
printf(&quot;change direction PPDATADIR=%d ret=%dn&quot;, dir, rc);
}


byte = 0;
for (loop = 0; loop < 10; loop++) {
rc = ioctl(fd, PPRDATA, &byte);
printf(&quot;PPRDATA=%0x rc=%dn&quot;, byte, rc);
sleep(1);
byte++;
}


rc = ioctl(fd, PPRELEASE);
printf(&quot;pprelease: %dn", rc);
close(fd);
}

 &nbsp;  Ikeya

Re: allocation of io_addr_t
user name
2007-06-16 05:36:34
Hi, Putu!!
Will you show me where can I find in MatPLC manual such keywords as you wtite below.
Map, inv, L5...

2007/6/14, putu.narasanthastudent.sgu.ac.id">putu.narasanthastudent.sgu.ac.id < putu.narasanthastudent.sgu.ac.id">putu.narasanthastudent.sgu.ac.id>;:
map inv in &nbsp;D.0 L5
map inv in &nbsp;D.1 L6
map inv in &nbsp;D.2 L7
map inv in &nbsp;D.3 L8
map&nbsp; &nbsp;  out D.4 L1
map&nbsp; &nbsp;  out D.5 L2
map&nbsp; &nbsp;  out D.6 L3
map&nbsp; &nbsp;  out D.7 L4


IL Language
user name
2007-06-17 22:45:09
hi MatPLC developers, 

I'm having difficulties of using IL language. Especially
using AND or OR 
command
Is it right if my command goes like this: 

AND left
AND right
SET L1
RST L2
RST L3
RST L4 

or 

LD left
AND right
SET L1
RST L2
RST L3
RST L4 


thanks, and btw thanks for the help using parport module 


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: allocation of io_addr_t
user name
2007-06-17 22:47:18
Mr. Ikeya, I find it at the basic_parport demo on the
matplc.conf 

hope it useful 

thanks for the help 

 

takeshi ikeya writes: 

> Hi, Putu!!
> Will you show me where can I find in MatPLC manual such
keywords as you
> wtite below.
> Map, inv, L5... 
> 
> 2007/6/14, putu.narasanthastudent.sgu.ac.id <
> putu.narasanthastudent.sgu.ac.id>:
>> 
>> map inv in  D.0 L5
>> map inv in  D.1 L6
>> map inv in  D.2 L7
>> map inv in  D.3 L8
>> map     out D.4 L1
>> map     out D.5 L2
>> map     out D.6 L3
>> map     out D.7 L4 
>> 
>> 
 


WELCOME TO THE WORLD OF TODAY 

"YESTERDAY ONLY A HISTORY,
TOMORROW ONLY A MYSTERY, AND
TODAY IS A GIFT" 


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


Re: parport problem, VERY NEED HELP, PLEASE!!!
user name
2007-06-18 00:46:26
Hi Matplc developers, 

I'm still having difficulties on receiveng an input from
outside. My sensor 
have a working voltage range = 24V and the sensor is
connected to 
optocoupler, and then from the optocoupler to the pararel
port. For your 
info, my optocoupler is an active low (when bits 0 then it
send a signal to 
the pararel port). I will show you the confiuration that I
use: 

matplc.conf:
[PLC]
#synch the modules
synch chaser_il -> vitrine
synch vitrine   -> chaser_il
synch_start chaser_il
synch chaser_il -> parport 

[PLC] 

#module Kbd ../basic/kbd
module chaser_il "./chaser_il"
module vitrine "../../mmi/curses/vitrine"
module parport "../../io/parport/parport";
module plcshutdown "../../lib/util/plcshutdown" 

point L1	"light 1" chaser_il
point L2	"light 2" chaser_il
point L3	"light 3" chaser_il
point L4	"light 4" chaser_il
point left	"<- (key L)" chaser_il
point right	"-> (key R)" chaser_il
point quit	"quit (key Q)" Kbd
point up	"-> (key U)" chaser_il
point down	"-> (key D)" chaser_il 

*include vitrine.conf 

[Kbd]
key 38 left
key 19 right
key 16 quit 

# no debugging messages
quiet = 1 

[plcshutdown]
# configure which point will be used to shutdown the plc
quit_pt = quit 

# specify period for all the shutdown module, so it doesn't
hog the CPU
plcshutdown: scan_period = 0.01 

[parport] 

# The parallel ports base address.
io_addr = 0x378
# If you prefer to go though the kernel driver, then specify
the device file
dev_file = /dev/plc_parport0 

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

# define the direction {in | out} the C register should use
Cdir = in
map inv in D.0 left
map inv in D.1 right
map inv in D.2 up
map inv in D.3 down 


And this is my chaser_il file:
LD left
SET L1
RST L2
RST L3
RST L4 

LD right
SET L2
RST L1
RST L3
RST L4 

LD up
SET L3
RST L1
RST L2
RST L4 

LD down
SET L4
RST L1
RST L2
RST L3 

END 

### 

Please help me with this, Thanks 


------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
MAT-devel mailing list
MAT-devellists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mat-devel


[1-10] [11-20] [21-23]

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