shs...@fh... schrieb am 27.06.04 18:46:47:
>=20
> hi thomas,
> thank you for the same. could also fix it, it was just a typedef problem=
> and there was a little conflict. minor one. sorry for bothering u for
> that.
I tried to do it in a way that is compatible with next version of visual, =
i.e. the defines are in mytypes.h
> i tested the driver and the writes to the flagwords are functioning well=
.
> i was trying to read the output word but i did not get much time
> yesterday.
So may I assume the driver works ok=3F
> please send me the perl code for updating the sheet so that i can also d=
o
> some work in that direction.
As I said, I must do a little search for it. I=B4ve been very busy the last =
days.
> now there is a small observation regarding speed.
> i am writing from from words 4 to 76 some values from 0 to 64K unsugned.=
> so when i try to write to the PLC these values it takes a while to uploa=
d
> them.
The way the driver does it is not optimized for writing:
When reading, the whole block defined on a tfi line is transferred in a si=
ngle packet. With write, a UDP packet is sent for each cell that has chang=
ed value (all on first start). Normally, I think this is appropriate for a=
SCADA system, it has to read ALL values from the PLC as it cannot know of=
changes otherwise.=20
With write it knows. And it makes it possible to connect multiple instance=
s to the same PLC, commanding a machine from multiple locations: Last chan=
ge wins like when you have more than one switch for the light in your room=
. In this case, the single instances of an hmi page should display values =
read back from the PLC so they will be up to date when another station cha=
nged something.
In the start phase, when all cells are considered to be changed, the write=
delay should be small compared to the time needed for the rest of the sta=
rt up process.
> what do u think could be the fastest way to write them to the PLC=3F=3F
Write them in a single block. This would need an "optimizer" that detects =
changes of consecutive cells that could be transmitted in a single packet.=
It should be implemented in PLCdriver.cc which is commen code for all byt=
e/word block oriented PLC drivers (in next version). I currently do not pl=
an to implement such an optimizer, but as it is open source maybe somebody=
else will=3F
>=20
> actually i use cell A1 as a switch and then write the values from D1 to
> D76 fro the flagwords and then send them to the PLC.
> could u suggest anything. i can mail u the tfi and sht files later as i
> cannot connect to the g=F6ppingen server from my home right now.
>=20
> please let me know your suggestions.
Let me have a copy of the debug output. If you really perceive a considera=
ble delay for 76 UDP packets, it might be worth to benchmark VISUAL and th=
e CPU.
>=20
> ok i have a question for you. why do different processor architectures u=
se
> this little endian or big endian byte ordering. any specific reason to d=
o
> that.
Taste and history... Wherever mankind had the possibility to choose from e=
qually good alternatives, some went this and some went the other way...
In the early days of machine code programming (without symbolic assembler =
and automatic address calculation), it could have been a little bit easier=
to expand the size off variables in little endian, as you could append mo=
re bytes maintaining the address and references. On the other hand you wou=
ld have had to foresee the extra space in the first place or you had to sh=
ift subsequent addresses.
Big endian, on the other hand, resembles the way we use to write numbers.
> i had written a similar udp driver like urs but i could not get the byte=
> ordering right and hence it worked for words with small values. i could
> not load block of memory and the output from the pLC was always false.
> could u say something abt this
I tried to do it once and for all drivers in PLCdriver.cc. So you can use =
big letters in the format string to denote big endian.
I did not look to much at the code you sent me to tell you where the probl=
em is. You may use a debugger or print out some byte sequences to find it =
out.
What sounds strange to me is: Because both, BECK PLC and Intel based PCs u=
se little endian, you do not need a conversion at all.
On the other hand a port of the BECK driver to power PC Linux (Motorola, b=
ig endian) would.
Thomas
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
Aufnehmen, abschicken, nah sein - So einfach ist=20
WEB.DE Video-Mail: http://freemail.web.de/=3Fmc=3D021200
|