MpDataRecorder / RegisteredPVCount behavior - Migration to AS 6.5

Hello everyone,

I am currently migrating a project from Automation Studio 4.12 to Automation Studio 6.5 and I am experiencing a different behavior with MpDataRecorder.

In my project I use MpDataRecorder together with MpDataRegPar.
The recording is started only after all PVs are registered, by checking Info.RegisteredPVCount.

In AS 4.12, when changing the PV set:

  • RegisteredPVCount was updated correctly

  • disabling MpDataRecorder reset the counter

In AS 6.5, instead, I observe that:

  • when changing the PV set, RegisteredPVCount keeps increasing

  • the value does not decrease and is not reset

As a result, I can no longer use RegisteredPVCount as a reliable condition to detect when all PVs of the current set have been registered.

My questions are:

  • has the intended behavior of MpDataRecorder / MpDataRegPar changed in newer Automation Studio versions?

  • is there a new setting or recommended procedure to handle dynamic changes of PV sets?

  • is there another recommended way to verify that all active PVs are registered?

Thank you in advance for any clarification or suggestions.

Hi @d.perla ,
Which mapp Services release are you using?
Thanks
Ciao
Valerio

Ciao @valerio.manenti
I am using Mapp Services 6.5.1.

Thanks Donatella,
I have to check with small demo prj if I can reproduce that, if I can I’ll try to downgrade the version to see the issue was there in all 6.x release.

Ciao

Hi @d.perla ,
I’m sure there is a point that I don’t get it so I need your help to reproduce your sequence.
In my test I have declared 5 MpDataRegPar FUBs and one MpDataRecorder, where only one MpDataRegPar FUB is enabled in the _INIT:

//5 global variables
VAR
    gTemperature1 : REAL;
    gTemperature2 : REAL;
    gTemperature3 : REAL;
    gTemperature4 : REAL;
    gTemperature5 : REAL;
END_VAR

VAR
    MpDataRegPar_0 : MpDataRegPar;
    MpDataRegPar_1 : MpDataRegPar;
    MpDataRegPar_2 : MpDataRegPar;
    MpDataRegPar_3 : MpDataRegPar;
    MpDataRegPar_4 : MpDataRegPar;
    MpDataRecorder_0 : MpDataRecorder;
END_VAR

PROGRAM _INIT
    MpDataRecorder_0.Enable := TRUE;
END_PROGRAM

PROGRAM _CYCLIC
    gTemperature1	:= gTemperature1 +1;
    gTemperature2 	:= gTemperature2 +1;
    gTemperature3	:= gTemperature3 +1;
    gTemperature4 	:= gTemperature4 +1;
    gTemperature5 	:= gTemperature5 +1;
  
    MpDataRecorder_0.MpLink := ADR(gDataRecorder);
    MpDataRecorder_0.DeviceName := ADR('USER');
    MpDataRecorder_0.SamplingTime := T#1s;
    MpDataRecorder_0.RecordMode := mpDATA_RECORD_MODE_TIME;
    
    MpDataRegPar_0.MpLink := ADR(gDataRecorder); 
    MpDataRegPar_0.PVName := ADR('gTemperature1'); 
     
    MpDataRegPar_1.MpLink := ADR(gDataRecorder); 
    MpDataRegPar_1.PVName := ADR('gTemperature2'); 
    
    MpDataRegPar_2.MpLink := ADR(gDataRecorder); 
    MpDataRegPar_2.PVName := ADR('gTemperature3'); 
    
    MpDataRegPar_3.MpLink := ADR(gDataRecorder); 
    MpDataRegPar_3.PVName := ADR('gTemperature4'); 
    
    MpDataRegPar_4.MpLink := ADR(gDataRecorder); 
    MpDataRegPar_4.PVName := ADR('gTemperature5'); 
    
    MpDataRecorder_0(); 
    MpDataRegPar_0(); 
    MpDataRegPar_1(); 
    MpDataRegPar_2(); 
    MpDataRegPar_3(); 
    MpDataRegPar_4(); 

END_PROGRAM

Then I command (in watch) MpDataRecorder_0.Record = True and I see TotalSamples increases

now I stop recording: MpDataRecorder_0.Record = False

In the next step I enable all MpDataRegPar FUBs:

then I command again Record=True and no issue:

then I stop recording: MpDataRecorder_0.Record = False

In the next step I disable the last 3 MpDataRegPar FUBs:
As you see below MpDataRecorder_0.Info.RegisteredPVCount = 2 (it was 5 in the previous step)


then I command again Record=True and no issue:

When I tried to enable MpDataRegPar_1 during recording I got the error (expected behavior):

so even if you change the PVName onfly on MpDataRegPar you need to disable MpDataRecorder_0.Record first.
β€”β€”β€”β€”β€”β€”-
I see same behavior with AS 4.12.8:
All MpDataRegPar Fubs disabled β†’ MpDataRecorder_0.Info.RegisteredPVCount = 0

I Enable MpDataRegPar_0 and MpDataRegPar_1 β†’ MpDataRecorder_0.Info.RegisteredPVCount = 2

Start Recording no issue

Stop recoding: I still see MpDataRecorder_0.Info.RegisteredPVCount = 2

I Enable all MpDataRegPar Fubs β†’ MpDataRecorder_0.Info.RegisteredPVCount = 5

Start recording β†’ no issue

Stop recoding: I still see MpDataRecorder_0.Info.RegisteredPVCount = 5

I Enable only MpDataRegPar_0 and MpDataRegPar_1 β†’ MpDataRecorder_0.Info.RegisteredPVCount = 2

Start recording no issue

Thanks
Ciao
Valerio

Hi @d.perla , have you found solution for your issue? can you update us?

Hi Valerio, hi Jaroslav,

I would like to add that I need to perform some additional tests to better understand why this is not working as expected on my side.

I will keep you updated as soon as I have more information or clearer results.

Thank you both for your support.

2 Likes