Problem with blobGetValue

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
4 posts • Page 1 of 1
Vakhnovwtskiy
Posts:5
Joined: Mon Feb 10, 2020 3:35 pm

Problem with blobGetValue

Post by Vakhnovwtskiy »

Hello
I want to use blobGetValue function for convert hex to dec

I took an expample from help:

main()
{
blob source;
int len, pos;
string s;
int value;
bool bigendian;
s = "DDAB003AFFABFFAB003AFFAFFAB003AFFABFFAB003AFFABB";
source = s;
DebugN(source, bloblen(source));
len = 2;
pos = 1;
bigendian = TRUE;
blobGetValue( source, pos, value, len, bigendian );
DebugN("Blob GetValue : " , value ); // Debugging -21760, integer value of the decimal system
}

It works. My log:

WCCOAui1:[Blob encountered with 24 items, dump follows
WCCOAui1:dd ab 0 3a ff ab ff ab 0 3a ff af fa b0 3 af fa bf fa b0 3 af fa bb
WCCOAui1:][24]
WCCOAui1:["Blob GetValue : "][-21760]


But if I change len to enother value, for expamlpe 3, 5 or 6... I will get this error:

WCCOAui (1), 2020.09.14 18:19:27.789, CTRL, WARNING, 76, Invalid argument in function,
Module: _QuickTest_
Panel: C:\WinCC_OA_Proj\Tests\panels\newPanel.pnl [newPanel.pnl]
Object: 0 named: "PUSH_BUTTON1" of type: PUSH_BUTTON
Script: Clicked
Line: 14, blobGetValue, Illegal len for this type of target
WCCOAui1:[Blob encountered with 24 items, dump follows
WCCOAui1:dd ab 0 3a ff ab ff ab 0 3a ff af fa b0 3 af fa bf fa b0 3 af fa bb
WCCOAui1:][24]
WCCOAui1:["Blob GetValue : "][0]



What is the problem?

dbindernagel
Posts:161
Joined: Mon Feb 23, 2015 1:34 pm

Re: Problem with blobGetValue

Post by dbindernagel »

Never used this, but the value variable is an integer so I would assume the function only accepts 2, 4, 8, 16, ... bit as value for len.

Vakhnovwtskiy
Posts:5
Joined: Mon Feb 10, 2020 3:35 pm

Re: Problem with blobGetValue

Post by Vakhnovwtskiy »

Probably. Thank you for idea.

gschijndel
Posts:376
Joined: Tue Jan 15, 2019 3:12 pm

Re: Problem with blobGetValue

Post by gschijndel »

For an (u)integer valid lengths are 1, 2 or 4. For (u)long also 8 is a valid length.
The length is in bytes.

4 posts • Page 1 of 1