CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Wed Feb 26, 2020 5:23 am

All times are UTC+01:00

Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Recipe Management
PostPosted: Mon Apr 23, 2012 8:58 am 

Joined: Tue Apr 17, 2012 2:53 pm
Posts: 1

I'm trying to work with Recipe Management on Codesys V3.
I showed 3s example to start ("RecipeDemo").

The RecipeManCommands.GetRecipeNames or .SetRecipeValues accept pointer to array of string as parameter.

I use an array of string to read recipe name or save values, but i need convert one by one my parameter to array of string.

I have a struct composed by different parameter and I have to convert Type_to_string.

Is there a function to put values of a struct in array of string and the opposite?
Mystruct.a (INT) = 100      -->int_to_string()             array[0] = '100'
Mystruct.b (BOOL) = TRUE    -->bool_to_string()        array[1] = 'TRUE'
Mystruct.c (STRING) = 'TEST'                                    array[2] = 'TEST'

My struct --> array of string --> recipe file.

For the moment I use a pointer of byte to point on the first element of my instance of struct, and I move the pointer in base of type of data to copy data from array of string to my struct.
I have an other problem, when I read an Integer value by my array of string I read the ASCII character corrispondent (for example char= 'W' int value = 87).
Is possible to convert the ascii character to value code?

Thank to all for your reply.

 Post subject: Re: Recipe Management
PostPosted: Mon Aug 20, 2012 6:44 am 

Joined: Sun Sep 19, 2010 4:19 pm
Posts: 11
Hi Matteo,

I think your structure is like this

Rec_Name : String;
Var1 : Int
Varn : Int

Once if you are entering the new value to receipe name then you can run the loop in the first element and you can find the string is there or not
if it is there then the instance will be having the value, with the help of the instance value move all the values in the present to required array

I think some codesys library contains this function TBL_RDWR, This function will do all this operations

If you want code then you can mail me to the below ID

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 11 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited