NootNoot Posted April 8, 2020 Report Posted April 8, 2020 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.
NootNoot Posted April 20, 2020 Author Report Posted April 20, 2020 (edited) Hi guys anyone any ideas for me? Thanks Edited April 20, 2020 by NootNoot
IO_Rack Posted April 20, 2020 Report Posted April 20, 2020 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...)
NootNoot Posted April 29, 2020 Author Report Posted April 29, 2020 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
Michael Walsh Posted April 29, 2020 Report Posted April 29, 2020 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: 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now