S7 - more indirect addressing problems, or maybe not?

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
For those of you who, like me, have a week's holiday coming up, I've got a nice little problem to keep you from getting too bored!

The Trigger signals for my 21 Capacitor Bank Modules can be delayed by 0 to 2000 mS, these times are either entered by the operator or are pulled up from a recipe DB (the same DB where the operator input lands). Since the Timers in the FM352-5, where this delay is timed count in 10µS increments, the mS value needs to be multiplied by 100 before being used to preset the Timer.

Up till now I did this by multiplying the value as I was transferring it over to the FM, however, this bit me when I had delays of zero. Because the Timers don't actually run if the preset period is zero, I needed to modify the 0 delay to a 10µS delay (preset = 1), however, when this got passed over to the FM, it also got multiplied by 100 giving a delay of 1 mS instead. 10 µS difference is irrelevant, but 1 mS definitely is not!

So I had to change things and modify the operator inputs to cater for the 10µS period before passing the data over to the FM. Doesn't sound very difficult, but for some reason, it doesn't work!

I went chasing the problem with breakpoints and this is what I turned up:

FC23_1_PLCS.JPG


As you can see in AKKU2 we've picked up Module 18 (12 hex) which is the first selected module. The Module select BOOLs are in Bits 0.1 to 2.5 of DB4 (the recipe DB) and AR1 is showing 2.2 which is the correct address for Module 18's select Bit. The VKE Bit is set, indicating the module has been selected. So far, so good, on to the next step:

FC23_2_PLCS.JPG


and this is where things start to get slightly peculiar. The Breakpoint is set immediately after having picked up the delay time (in mS) in this case for Module 18 as an INT in DBW 52 and sure enough, in AKKU2 we've got 1A0 = 416 decimal which divided by 8 (to correct to Pointer Byte.Bit format)= an Offset of 52. Only for reasons best known to itself, AR1 is still showing 2.2! However, in AKKU1, we've got 76 hex = 118 = Module Nr. + 100, which is what I stored in the DB. By the way, I initially stored the Module number itself, but that got a bit confusing, because it was then not too clear which value was in the AKKU. Since this change was visible, I think I can be pretty sure that I'm picking up the correct data.

OK, now on to the last bit, multiply by 100 and store the new value in newly created DINTs at the end of the recipe DB:

FC23_3_PLCS.JPG


Once again we've got our peculiarity, that AR1 is still showing the offset as 2.2, however, in AKKU2 we've got 440 hex = 1088 decimal = Offset 136 when divided by 8, which is the correct address. In AKKU1 we've got 2E18 hex = 11800 decimal so the multicplication's worked OK, but when we go have a look in the VAT table, after refreshing with F7, just to be on the safe side:

FC23_VAT_PLCS.JPG


down near the bottom of the VAT table, you find DB4.DBD136 with its new contents: 773324800!!!!!

All ideas most welcome! I'm taking the 314 back home with me, so if anybody comes up with some suggestions, I'll be able to try them out!

Cheers

Roy

PS, I forgot to mention the destination DINTs were initially set to zero, and at this point, all the other locations still were 0, so the correct address has been written to, even if the contents are rubbish.
 
Last edited:
Hey Roy,

I'm on my way to work so I only had a minute to look, but maybe I found something. When I see a wild number that I don't expect in the accumulator, the first thing I do is convert it to hex and see if that makes sense. So, when I convert 773324800 to hex, I get 2E180000, and coincidently 2E18 is in the accumulator in your second pic. And, it looks like you are writing to an INT in your code, but I see a DINT in the VAT table. Could that be it?
 
Hi S7Guy,

I'll have to go and try it out, but I'm pretty sure you've hit the nail on the head. This FC was originally just passing the mS time on to the communications Block for the FMs, so Input and Output were both INTs. Going back up to the case where the module is not selected and the delay is set to 0, I've caught it there and changed it to DBD, but forgotten the last two places. Originally, of course, there was just the one Parameter, "Delay_Offset" which then got changed to "Delay_Offset_IN" and then after adding the Parameter "Delay_Ofset_OUT", I just went down and changed the "IN" (which had changed automatically, of course) to "OUT" forgetting to change the "DBW" to "DBD" in the process.

Edit:

By the way, thanks for the tip about changing funny looking numbers to hex. If I'd thought of that, I could probably have solved the problem on my own! I'll certainly remember it in future!:)
 
Last edited:

Similar Topics

Hello, i need to use P_Intlk and feed the Status interlock OK bit to a P_DOut block. However, there's 17 interlocks for this output. How can I...
Replies
1
Views
108
Hi everyone, recently i worked with a cmore panel and have the question that how can clear alarm list whit remote form,right now only can with...
Replies
0
Views
107
Hello, friends, I am trying to upgrade a system that uses an Onrom incremental encoder (E6B2-CWZ6C) connected to a Danfoss VFD (FC360), but now...
Replies
4
Views
272
Hello Friends I have took the sample program from AB webpage and modified, but I can only send 127 chars...
Replies
1
Views
181
Hello, I am new here and have been working with PLCs for a few years now. I have been tasked with setting up a Micrologix 1400….. to a Cmore 10...
Replies
10
Views
493
Back
Top Bottom