1/25/2013 2:08 AM | |
Posts: 3 Rating: (0) |
Hi krkr Yes it is possible, we have a machine wriiten in SCL which does this, we only see an STL version of the code though Have a look at the attachment, you can use pointers to get to your inputs/outputs, not sure how to code it, I've only used pointers to move data around inside DBs. Basically from what I understand, in a DB you set up an array of however many inputs you need, include the input byte and bit data as integers. Using a function call set up a temp struct and declare the byte and bit. Right here is the best explanation I can give: Let us say that for each input we have4 words of data, at the start of the block we load into the index the first position of the first word, we execute our code and add one to the index, we do this until the index reaches our number of inputs and is reset to 0 to start again. We use the index to get the start position within the DB, from there you can point to your byte and bit number to store in temp.you can then load this temp dataand store it in AR1 to read your input. L #temp_byte IDT L #8 *D L #temp_bit IDT +D LAR1 A I [AR1,P#0.0] = //Whatever you want hope that helped, I'm definitely no expert, indirect addressing is very new to me! AttachmentVolume 2 describes Register Indirect Addressing.pdf (278 Downloads) |
1/28/2013 5:18 PM | |
Joined: 8/31/2005 Last visit: 7/18/2024 Posts: 2198 Rating: (328) |
The attachmentcopies a a periphery input word to a periphery output word (and the following output word), if the Bit "On" is set. AttachmentD:\SCL .zip (327 Downloads) |
|
|
Follow us on