-> Hier kostenlos registrieren
Hallo zusammen,
ich hoffe Ihr könnt mir helfen.
Ich habe eine WinCC Variable als Double.
Daraus möchte ich bei Wertänderung die Daten in zwei interne Variablen mit dem Typ int oder long aufsplitten.
Aber ich komm leider nicht weiter.
Könnt Ihr mir helfen?
Ich hab zwar in der Siemens Hilfe das gefunden:
int wert, high, low;
wert = GetTagWord( "16Bit" );
// Get the 16 Bit process value
high = wert>>8;
// filtering high byte of the process value
low = 0x00ff & wert;
// filtering low byte of the process value
SetTagByte( "8Bit_1" , high );
// save high byte of the process value
SetTagByte( "8Bit_2" , low );
// save low byte of the process value
aber das macht halt aus 32 bit 16ner.
Vielen Dank schon mal vorab.
Gruß
Thomas
ich hoffe Ihr könnt mir helfen.
Ich habe eine WinCC Variable als Double.
Daraus möchte ich bei Wertänderung die Daten in zwei interne Variablen mit dem Typ int oder long aufsplitten.
Aber ich komm leider nicht weiter.
Könnt Ihr mir helfen?
Ich hab zwar in der Siemens Hilfe das gefunden:
int wert, high, low;
wert = GetTagWord( "16Bit" );
// Get the 16 Bit process value
high = wert>>8;
// filtering high byte of the process value
low = 0x00ff & wert;
// filtering low byte of the process value
SetTagByte( "8Bit_1" , high );
// save high byte of the process value
SetTagByte( "8Bit_2" , low );
// save low byte of the process value
aber das macht halt aus 32 bit 16ner.
Vielen Dank schon mal vorab.
Gruß
Thomas