NootNoot

FWRIT(701) To Memory Card

5 posts in this topic

Hi

Can anyone please help with the following issue.

Equipment 

PLC - CJ2M-CPU33

Setup is being used to log distance measurements from a conveyor belt to a compact flash card in the PLC

I have successfully set this up and it is working by writing values to a stack then when this is full, changes stack and writes the data in the previous stack to the card.

The FWRIT command has the control word #3D00 (Comma-Delimited, Return every 16 fields, Append, Memory Card)

The problem I am having is with the data in the CSV file, I am logging typically 300K lines with 16 values.  

Towards the end of logging the data in the CSV file will start to return every 5 values instead of 16 which is just painful to re-format.

I have attached an image of the Excel data to explain better.

My Two stacks are 

Stack 1 - E0_0   -   E0_16003

Stack 2 -  E0_16010   -   E0_32013

 

Thanks for any help.

Excel Snip.JPG

Share this post


Link to post
Share on other sites

Hi guys anyone any ideas for me?

Thanks

Edited by NootNoot

Share this post


Link to post
Share on other sites

It's difficult for any of us to determine what is wrong. Can you post the program?

Is your Control WORD a hard value of #3D00? Or is it variable? (Dxxxx)

Is the data available? Or are they really 0's?

Is the FWRIT preceded by NOT A343.13?

For troubleshooting, try monitoring the Auxiliary Area Flags from the Instruction Help section. Try inputting static data in the Source so you'll know what to expect. (1, 2, 3, etc...)

Share this post


Link to post
Share on other sites

Hi mate,

Yes the control word is a fixed value. 

The data is available in the CSV file it just changes the data layout from a return every 16 words to every 5 words, but only on the last stack that is written.

Yes the FWRIT is preceded by NOT A343.13

I have attached a copy of the program if you have a chance to have a look, hopefully its something obvious which I am not seeing.

 

Thanks for your help

2020-04-26 - Deflection Rig Mobile.cxp

2020-04-26 - Deflection Rig Mobile.opt

Share this post


Link to post
Share on other sites

I am guessing that it has something to do with the logic in Rungs 0 and 1 of the Stop section (I am only showing rung 0 below).  You have this code there:

FWRIT.thumb.jpg.3a6c1e3fc11faf3d9da2d102

The 3C makes it write 5 records (as I am sure that you know).  You are using the same address for the file name.  Are you inadvertently using this FWRIT at the point when it switches to a return every 5 fields.

Share this post


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