Jump to content
Sign in to follow this  
ORSO2001

Strange problem with DTI and Struct (local)...

Recommended Posts

Dear All,

I have a Struct that have 13 variables (String, Bit, and uint32); I created 4 global variablea to record these datas; I have created a DTI with a single row to take these information and save into a file if some event arise.

When the event arise I don't have to record all the informations as these are but I have to modify a litte; then when the event arise I store one of the global struct into a local struct (same struct) , write this in the DTI and copy (append) this DTI in the file (already present).

what I have is that if I use a LOCAL struct the data is store with "wrong value" (strange characters) and also the last value that is a BIT is stored in a 14th column in the csv file that don't exist; if I use a global Struct (convert the local to global) all works. I don't tried to "reset" the local Struct, to inizialized, before populate it...but until now (other projects), if I well remember, was not necessary.

I am using last version of Unilogic 1.26.

Share this post


Link to post
Share on other sites

Hi,

Local structure lost/corrupt data outside of subroutine .

When you require to save data to SD, Ladder leave routine and cannot pass right data to SD driver.

This is how local variables are working.

Use Global structure. Than it will work.

B.R.

 

Share this post


Link to post
Share on other sites

Hi AlexUT,

thanks for the answer...one thing is not clear (for me)...before write the SD file I store the local struct to the DTI...is not like save in a "global variable" (DTI) and use this to write the information to the file?

Share this post


Link to post
Share on other sites

I will try to do a single UDFB project to replicate the issue...otherwise I can send the project, is not so big, and I will highlight where I do this.

Share this post


Link to post
Share on other sites

hi Saragani,

I sent a mail to the support that include the project and the .csv file that show the problem.

the object of the mail is the same of this thread

I confirm that if the local struct is "reset", see the first row of the UDFB where the problem arise, that in the copy that I sent is disabled, the problem is not present; seems a problem with one of the strings of this struct that exceed its lenght...if you will check the .csv file will see that the not inizialized strings take "strange" characters.

thanks and regards

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...