Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: CReese on March 26, 2014, 02:36:24 PM
-
Hello,
While I appear to be able to write TO a DL series PLC bit address or addresses from a DoMore using DLWX, I don't seem to be able to write FROM anything but word addresses. Does this mean I need to take my bits and put them into words on the DoMore side, or is there something I am missing?
Thanks,
Colin
-
The DL protocol is a BYTE oriented protocol, hence you must specify a starting bit for the Source Do-more element that is on a BYTE boundary, and you must send a multiple of 8 bits (i.e. the instructions ask you for number of BYTEs, so 1 BYTE would be 8 bits).
That means using a numeric register OR a BYTE CAST on a BIT that is BYTE aligned, e.g. C0:UB, C8:UB, X32:UB, etc.
-
That's fine. What's the easiest way to cast 8 bits into a byte? Say they are non-contiguous, like one bit from a position in an array, one from a variable etc. If I choose to send a couple bytes of bits starting at, say, V2000, can I cast a bit into a specified position within the byte? That would be ideal. I can obviously hack a bit to word, send a word, and then convert back to bit, but then I'm sending 8x the data I need to.
Thanks,
Colin
-
I see. I can copy them to a contiguous memory location and then cast from the location using UB. That will work.
-
That's fine. What's the easiest way to cast 8 bits into a byte? Say they are non-contiguous
The most compact in terms of screen real estate: MAPIO. The fastest execution: CONTACT/OUT COIL, CONTACT/OUT COIL, ...
-
I went for contact/out.
Funny thing -- how do I get a DLWX to run every cycle? I have it in a program that exits after each completion, and it's set to run in main.
-
I went for contact/out.
Funny thing -- how do I get a DLWX to run every cycle? I have it in a program that exits after each completion, and it's set to run in main.
Is it using Stage?
-
Yes.
S0 : poke values, DLWX, S1/S2 Success/Fail
S1 : Success, JMP S3
S2 : Fail, JMP S3
S3 : EXIT
Runs once on switch to RUN, then not again.
-
I got it. JMP to S0 with timer. STILL wrapping my head around program execution.
-
If the "normal" behavior is to "poll", I would make S3 have a condition with a "keep polling" bit (say C100)
SG S3
STR C100 // if C100 is on, do it again
JMP S0
STRN C100 // if C100 is OFF, exit the program
EXIT
Then, $Main (or whoever) can STOP the polling by RESETTING C100. Although to restart, you gotta SET C100 then RE-FIRE the RUN MyDLWXProgram (make the input into the RUN instruction go LOW then HIGH - it's LEADING EDGE triggered).
OR, if you want COMPLETE control in $Main (i.e. you aren't polling, but want to do it on an "event"), refire the "event" logic driving the RUN MyDLWXProgram.
-
Yes, typically what I do is have a <<routine>>Enabled bit, and in the last stage, a NC contact with EXIT. In MAIN then have a <<routine>>Enabled to RUN routine.
-
If you just want it to run continuously, just enable a box from $Main using interval mode set to 0ms.
-
I'll have to revisit this again, but for some reason this did not work when I was performing network operations.
-
Unless the instruction is broken, there is no easier way to continuously write values. When in interval mode, the input leg is level triggered...runs while on.