Is it possible to create stucture of variables

Hello All,

I was wondering is I can create a Data Structure of a couple variables. For example: I have in my Siemens S7 PLC a Datablock where I Store the actual values of my RGB dimmers the structure looks like this:

If I want to connect the variables in IP symcon now I have to create for each light 5 new variables. Which is doable but I have in total 20 RGB dimmers I need to control which means I have to create 100 S7 Variables… with 100 times the chance I make a little mistake. This would be a lot easier if I could just create a structure and give a DB number and a offset.

I hope there is something :wink: Or maybe a way to import Variables from Excel?

Best regards, Martijn

You can’t do that unfortunately. You can write your own importer though. Have a look at the IPS_CreateInstance, IPS_SetProperty and IP_ApplyChanges functions :slight_smile:

paresy

Thank you for your answer. Its not exactly the answer I was looking for but :wink: But this really helps!

I’ve don some test already but the first problem I cannot find any answer in your documentation is the function „IPS_SetProperty“

With this function I can make settings to the created Siemens instance. But what does for example value 7 from Property „DataType“ mean is it an smallInt or a Boolean or a byte or something else? Also the property „Area“ is it a Merker, DB or input etc. I can not find this in the documentation.
ÌPS_SiemensProperties.png

Thanks in Advanced!

Answering my own question because it might help others:

After a trail on error I found out this:


//--------------------------------------------------
// Siemens Device Poporties: 
// Address 		integer 	Example: I3.2 => 3 or M4.5 => 4 
// Area 		integer 	4=Inputs, 5=Outputs, 6=Merkers, 7=DataBlock, 13=Peripherals
// AreaAddress 		integer 	In case of DB is this the DBnr
// Bit 			integer 	0
// DataType 		integer 	0=Bit, 1=Byte, 2=Word, 3=Dword, 4=ShortInt (1 byte, DEC), 
//					5=SmallInt (2 bytes, DEC), 6=Int (4 bytes, DEC), 7=Real
// EmulateStatus 	boolean 	1
// Factor 		double 		0
// Poller 		integer 	0=value is in ms
// ReadOnly 		boolean		0
//----------------------------------------------------