2/22/2008 2:25 PM | |
Joined: 1/17/2007 Last visit: 4/15/2025 Posts: 1560 Rating:
|
I am trying to make a common communications block (in SCL) that be used with all CP types. Obviously each CP has it's own unique FC for sending/receiving data (e.g. CP340 uses FB3/FB2, CP440 uses FB10/FB9). SoI was thinking that maybe the user could specify the CP type as an input to the block, and that used as an index into a lockup table (array) containing the number of the relevant FC/FB required for send/receive. This number could then be used as the FC/FB number. The only wayI could see of doing this is to use an ANY pointer. The manual suggests that this is possible (see attached picture), but rather confusingly there are 2 data type entires (one at byte 1 and another at byte 6). Even if I get the ANY pointer to work with FC/FB's, and compile the SCL on a PCS7 S7-400 system, will the block then work ok on a S7-300 system without the need to re-compile the SCL sourceon the S7-300 system? AttachmentANY Pointer.zip (326 Downloads) |
Last edited by: smiffy at: 26.02.2008 10:04Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots. |
|
2/28/2008 11:01 PM | |
Posts: 2661 Rating:
|
If you do not use 300 or 400 specific blocks (orstatements)in your SCL code, you can use the compiled block in both CPU's. |
Follow us on