Jump to content

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


ORSO2001

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.

Link to comment
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.

 

Link to comment
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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.