Hi All,
I have an issue when a stored procedure is called from a Tag Change Event - Gateway Event Scripts.
The script is the following:
forno = '[MP4]Forni Invecchiamento/Eventi/Pw_Int_F1'[-1:] # Determino quale forno ha lanciato la script ( 1 = MF06 | 2 = MF07 )
IDFornoInvecchiamento = 'MF06'
NumeroInfornata = system.tag.readBlocking(['[MP4]Forni Invecchiamento/Pagine/Data_Recipe_String_F{}/01'.format(forno)])[0].value
DurataPrevistaMinuti = system.tag.readBlocking(['[MP4]Forni Invecchiamento/Pagine/Data_Recipe_int_F{}/08'.format(forno)])[0].value
print forno
print IDFornoInvecchiamento
print NumeroInfornata
print DurataPrevistaMinuti
# Chiamo la STORED PROCEDURE
call = system.db.createSProcCall("[dbo].[spScadaAperturaInfornata]","SomeDatabase")
call.registerInParam(1, system.db.CHAR, IDFornoInvecchiamento)
call.registerInParam(2, system.db.CHAR, NumeroInfornata)
call.registerInParam(3, system.db.SMALLINT, DurataPrevistaMinuti)
system.db.execSProcCall(call)
The results are:
1
MF06
MF06200814092406
330
[Error_TypeConversion("Error trying to coerce 'mf06' to a number.")]
I tried to use named argument names instead of indexed arguments but it’s the same.
Ignition 8.0.9
Any help?
Cheers,