Hello,
I would like to know how can I use API Function in WinCC OA 3.14 to display an image in a cell.
I've tried to return a BlobVar in an API Function but it just showed the Blob as Text.
Does anyone can help me out?
Thanks.
API Function in table cell to display image
- RudiKreiner
- Posts:198
- Joined: Mon May 16, 2011 2:10 pm
Re: API Function in table cell to display image
With a command like this you can set an image in cell of a table
setValue("", "cellFillRC", rowNumber, "columnName", "[pattern,[tile,bmp,apply_small.bmp]]"
I'm not sure exactly what you want to do with the blob, but if contains information about which cell the image should be in or what the name of the image file is, then you first need
to extract that information from the blob.
If your blob file contains exactly the command as I have described above, then I'm not sure it is possible to execute such a command in a script though. Maybe some else knows how to do that?
setValue("", "cellFillRC", rowNumber, "columnName", "[pattern,[tile,bmp,apply_small.bmp]]"
I'm not sure exactly what you want to do with the blob, but if contains information about which cell the image should be in or what the name of the image file is, then you first need
to extract that information from the blob.
If your blob file contains exactly the command as I have described above, then I'm not sure it is possible to execute such a command in a script though. Maybe some else knows how to do that?
- amichon
- Posts:93
- Joined: Sat May 17, 2014 3:49 pm
Re: API Function in table cell to display image
My goal is simply to display a picture in a table cell depending on an alarm value, class or whatever.
I tried to go by BlobVar return value in an API Function as a first try to solve my problem, I can't see any other WinCC Variable Type which could fill my need.
Thanks for you help
I tried to go by BlobVar return value in an API Function as a first try to solve my problem, I can't see any other WinCC Variable Type which could fill my need.
Thanks for you help
- RudiKreiner
- Posts:198
- Joined: Mon May 16, 2011 2:10 pm
Re: API Function in table cell to display image
I don't understand why you are using an API function
If you just write a script in the init function of you table and do a dpConnect() to the _alert_hdl.._value config of the alert dp that you are interested in, then in the work function of the dpConnect just set the table attributes as you want them, depending on the value of the datapoint config that gets passed to the work function
If you just write a script in the init function of you table and do a dpConnect() to the _alert_hdl.._value config of the alert dp that you are interested in, then in the work function of the dpConnect just set the table attributes as you want them, depending on the value of the datapoint config that gets passed to the work function