You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old September 19th, 2023, 03:56 AM   #61
Puddle
Member
United Kingdom

Puddle is offline
 
Join Date: Mar 2022
Location: UK - The Norf
Posts: 246
Looks like you're trying to log the whole data structure in your DB. The help file says there's no nesting of structures, which means the DTL values may not be permitted.

The helpfile doesn't specify, but I wonder if the header string is subject to the same restrictions as the name string.

The name (on a 1200) is restricted to ASCII 0x20 to 0x7E. I've been using a counter and VAL_STRG converter to provide the name for my logs and I had an issue early on with the string placing a space at the end and it wouldn't run due to not having a valid name.

Also didn't realise it automatically opens the log on creation.
  Reply With Quote
Old September 19th, 2023, 04:05 AM   #62
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
Yes.
Nice one, mate...you make it look easy.

I wish mine would do that - got a couple of things to try based on what you and @parky said earlier. Thanks
  Reply With Quote
Old September 19th, 2023, 04:11 AM   #63
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by Puddle View Post
Looks like you're trying to log the whole data structure in your DB. The help file says there's no nesting of structures, which means the DTL values may not be permitted.

The helpfile doesn't specify, but I wonder if the header string is subject to the same restrictions as the name string.

The name (on a 1200) is restricted to ASCII 0x20 to 0x7E. I've been using a counter and VAL_STRG converter to provide the name for my logs and I had an issue early on with the string placing a space at the end and it wouldn't run due to not having a valid name.

Also didn't realise it automatically opens the log on creation.
Just read this, thanks.

So if I understand you correctly, a data type STRUCT is not allowed here (see pic)?
EDIT: My mistake, you're talking about the DTL (date) types...I could temporarily remove them to see what happens.

Maybe if I change it so that each item in the struct is like a separate entry in the DB it might work. (?)
Attached Images
File Type: png data structure.png (290.5 KB, 37 views)

Last edited by Mas01; September 19th, 2023 at 04:13 AM.
  Reply With Quote
Old September 19th, 2023, 05:08 AM   #64
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by parky View Post
If it does take a few scans to log the data perhaps instead of using the button pulse, set a bit with the button then use that bit, reset the bit when the done bit is on (to be on the safe side perhaps a timeout timer to reset it should it fail.
This is very frustrating.

I did a SET of a bit (DB_Create_Flag) when 'first scan' is true (network 3 attached).

But the .Done bit from DataLogCreate_DB is never set, so the Reset is never performed (network 37 attached).

I really don't know why that is.
Attached Images
File Type: png Network 3.png (15.9 KB, 5 views)
File Type: png Network 37.png (34.4 KB, 4 views)
  Reply With Quote
Old September 19th, 2023, 05:20 AM   #65
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
Tried this out on an S7-1510S CPU, using the Siemens example as a basis and it does what is says on the tin. bCreate and bWrite are on for one scan.
Maybe I'm misunderstanding, but don't you mean the DONE outputs are only set for one scan?

For bCreate and bWrite , you need to set them TRUE in order to Create and Open the data Log.
  Reply With Quote
Old September 19th, 2023, 05:47 AM   #66
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,616
I manually set those bits (using modify operand) and then reset them programatically at the end of the FB, the screen shot trimmed off that bit of code.
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com
  Reply With Quote
Old September 19th, 2023, 05:49 AM   #67
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,616
i.e.
Attached Images
File Type: jpg log2.jpg (84.8 KB, 36 views)
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com
  Reply With Quote
Old September 19th, 2023, 06:57 AM   #68
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
I'm now getting realistic values being populated in the CSV file, but there's only 3 columns and no headers. (see first pic)

There should be 23 columns in the CSV file.

The 3 columns that are there are for the first 3 elements of Data, as defined in the DB (see 2nd pic). p.s. I've "trimmed" the struct to remove potentially problematic types like DTL/Date.

Can Anyone help? Thanks
Attached Images
File Type: png csv - good values but only 3 columns.png (274.8 KB, 6 views)
File Type: png Data struct.png (131.6 KB, 6 views)

Last edited by Mas01; September 19th, 2023 at 07:00 AM.
  Reply With Quote
Old September 19th, 2023, 07:20 AM   #69
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,616
How are you deleting the log file to test your changes?
I get all headers + columns of data, including Date and DTL
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com
  Reply With Quote
Old September 19th, 2023, 07:52 AM   #70
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
How are you deleting the log file to test your changes?
I get all headers + columns of data, including Date and DTL
I haven't been deleting the log file (maybe that's part of the problem).

I was assuming that each new Write to the CSV file would also add any missing headers and columns.

To see the new CSV file, I go to 192.168.0.1 and log in with the username/password. Then I open up the CSV to look for any changes/updates.
  Reply With Quote
Old September 19th, 2023, 09:03 AM   #71
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,616
Delete the log file and try again, the headers get written when you create the log.
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com

Last edited by L D[AR2,P#0.0]; September 19th, 2023 at 09:07 AM.
  Reply With Quote
Old September 19th, 2023, 10:03 AM   #72
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
Delete the log file and try again, the headers get written when you create the log.
Okay @LD, good call - I deleted the log file from the 192.168.0.1 web page where there's an option to delete the file (1st pic).

In the new file, the number of columns is correct, the values therein are correct and the number of headers is correct...as you can see, I still need to add a lot more headers (2nd pic).

Still work needs doing on this...need to add a few DTL/Date tags (I removed them from the struct in case they were problematic, so I was only logging Reals).

Nonetheless, a big step forward!

p.s. If anyone knows how to change language setting from Spanish to English in Excel, please let me know.
Attached Images
File Type: png Delete option.png (20.6 KB, 7 views)
File Type: png Correct number of columns and values.png (114.8 KB, 8 views)

Last edited by Mas01; September 19th, 2023 at 10:28 AM.
  Reply With Quote
Old September 19th, 2023, 11:01 AM   #73
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by Mas01 View Post
Okay @LD, good call - I deleted the log file from the 192.168.0.1 web page where there's an option to delete the file (1st pic).
Apologies - I tell a lie, deleting log from web page didn't quite work, so I used DataLogDelete to delete it.
Attached Images
File Type: png DataLogDelete.png (13.7 KB, 30 views)
  Reply With Quote
Old September 19th, 2023, 02:34 PM   #74
Puddle
Member
United Kingdom

Puddle is offline
 
Join Date: Mar 2022
Location: UK - The Norf
Posts: 246
I don’t think it allows you to delete open data logs.

I said it was a pain to get this going! I assembled it all into an FB and there’s around 5 tags to assign.
  Reply With Quote
Old September 20th, 2023, 04:09 AM   #75
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 918
Quote:
Originally Posted by Puddle View Post

I said it was a pain to get this going! I assembled it all into an FB and there’s around 5 tags to assign.
True! You did say that, I remember.

I just need to add a few more MOVE commands (if it's a MOVE I should be using) to move a few more things into the data log:
  1. Dates (types Date and DTL)
  2. Serial number (type String)
  3. Operator ID (type WString)

Can these be moved with MOVE commands or do they have their own special commands?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Siemens S7/TIA v18: Only allow input of alphanumeric values...... Mas01 LIVE PLC Questions And Answers 19 September 6th, 2023 09:55 AM
Siemens S7/TIA v18: Is there a "first scan" in TIA portal?... Mas01 LIVE PLC Questions And Answers 4 September 1st, 2023 11:29 AM
Siemens S7/TIA v18: What does "Object Number" mean?... Mas01 LIVE PLC Questions And Answers 4 August 31st, 2023 11:41 AM
Siemens S7/TIA v18: Data conversion DTL to DATE...... Mas01 LIVE PLC Questions And Answers 1 August 29th, 2023 09:16 AM
Siemens S7/TIA v18: WinCC: F7 needs to SAVE data AND advance the screen...... Mas01 LIVE PLC Questions And Answers 9 July 14th, 2023 09:45 AM


All times are GMT -4. The time now is 08:03 PM.


.