Jump to content
Vsam

CSV to UDF limitations

Recommended Posts

I have to retrieve and import a CSV file to a DTI. There is no problem about the FTP section, but when I try to convert a CSV file to an UDTF file I have got an error if the CSV file has more than 127 lines.

Is there a way to resolve this issue ? My final CSV file to import will maybe have near of 500 lines.

 

Thanks for reading

Share this post


Link to post
Share on other sites

This is always 127 lines independant of data read (only 1column byte, or 10 clumns of strings)

There is a way to go over:

I convert and import one line at time by cycling on the FB and inc an line number (see attached file)

 

Thanks

post-50741-0-95269900-1460378059_thumb.png

Share this post


Link to post
Share on other sites

I'm unable to reproduce the problem.

I've created a CSV with 1000 rows, and converted it to UDTF.

I can clearly see that it has 1000 rows.

 

I was then also able to use UDTF Count in order to count the rows and columns, and got the right result, and I was also able to load it to the data table using Load DTI from file.

 

 

I'm using a newer version of UniLogic and PLC Firmware, so I'll check tomorrow if there was a bug with this Utility in the current official version.

Share this post


Link to post
Share on other sites

Btw, looking at your screen capture, I see that you chain the CSV to UDTF and the Load DTI from file.

Both actions are IO actions (For example, communication, files read/write etc...), which means that they take a lot of time to complete, so they don't end in 1 ladder scan.

This might be the cause to your problem (Since you might cause some races). You should first convert the csv to udtf. The status should immediately change to "in progress" (I think the value is 1), and when the action is done, the status will either change to 0 (OK), or  an error.

If the status changes back to 0, the you can continue with loading the UDTF to the data table.

Share this post


Link to post
Share on other sites

I'm unable to reproduce the problem.

I've created a CSV with 1000 rows, and converted it to UDTF.

I can clearly see that it has 1000 rows.

 

I was then also able to use UDTF Count in order to count the rows and columns, and got the right result, and I was also able to load it to the data table using Load DTI from file.

 

 

I'm using a newer version of UniLogic and PLC Firmware, so I'll check tomorrow if there was a bug with this Utility in the current official version.

 

Thanks for your help,

I am usin the V1.16 rev44, i will look for any update.

Before posting I encoded this function two times from zero, to be sure to don't make a mistake, but i probably missed something.

For the current application i gone over by reading line by line, but i will need of these function in future applications (i will try anothertime)

(more and more customers wants to log production and an intergration in the factory level of data exchange)

 

Btw, looking at your screen capture, I see that you chain the CSV to UDTF and the Load DTI from file.

Both actions are IO actions (For example, communication, files read/write etc...), which means that they take a lot of time to complete, so they don't end in 1 ladder scan.

This might be the cause to your problem (Since you might cause some races). You should first convert the csv to udtf. The status should immediately change to "in progress" (I think the value is 1), and when the action is done, the status will either change to 0 (OK), or  an error.

If the status changes back to 0, the you can continue with loading the UDTF to the data table.

 

Sorry for the confusion, This screen was for a representation wihtout showing to many lines.

I am effectively waiting status changes to 1 or 2, and then come back to 0 before loading the UDTF to DTI function

If the status is negative the function is pending, I encoded a sequencial chart (grafcet).

 

Whatever thanks for your support who never disappointed me and sorry for my english. :-)

Share this post


Link to post
Share on other sites

OK, 

 

Can you supply the actual project, or a project that reproduces the problem + the CSV file.

You can send them to support@unitronics.com and ask them to forward it to me.

 

Thanks.

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.


×
×
  • Create New...