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 18th, 2023, 06:58 AM   #46
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
Quote:
Originally Posted by mk42 View Post

SO, right click on the PLC in the project tree and:
  1. compile HW (rebuild all)
  2. compile SW (rebuild all)
  3. download to device (HW & SW)
This worked!!!

In the (admittedly short) time I've been working on TIA Portal, I've NEVER done a compilation of the HW...in fact, when I selected PLC > Compile, the only options I saw were for SW download.
Then I realised, I had to be OFFLINE to be able to compile the HW!

So, I went OFFLINE and did your 3 steps above.
And "Bingo!" I can now reach 192.168.0.1. (see pics)

Then, On the web page, I logged in with my Admin01 account (having bumped up the privilege from Minimum to Administrative) and clicked on "Data Log".

Unfortunately, the file was empty - The filename is correct ('Report_Summary.csv'), but it didn't even contain the column Headers I was expecting to see - see pic - so I need to look into this. Why's the file empty?

Anyway, this is a huge step forward for me.

Lesson learnt: If in doubt, do a full HW and SW compilation!

Cheers!
Attached Images
File Type: jpg 192.168.0.1 reachable at last.jpg (96.5 KB, 5 views)
File Type: png DataLog Empty.png (98.6 KB, 5 views)

Last edited by Mas01; September 18th, 2023 at 07:18 AM.
  Reply With Quote
Old September 18th, 2023, 07:13 AM   #47
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
With respect to WHY the dataLog's empty, I will create some tags and Trace these outputs from DB7...
Attached Images
File Type: png create tags and trace these.png (130.9 KB, 34 views)
  Reply With Quote
Old September 18th, 2023, 09:55 AM   #48
Puddle
Member
United Kingdom

Puddle is offline
 
Join Date: Mar 2022
Location: UK - The Norf
Posts: 273
The log isn't open yet.

1. DataLogCreate
2. DataLogOpen
3. DataLogWrite
4. DataLogClose
5. DataLogDelete (optional)

Set up the DataLogOpen block with the same name and ID as the create block and then it will allow the DataLogWrite block to function.
  Reply With Quote
Old September 18th, 2023, 10:12 AM   #49
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
Quote:
Originally Posted by Puddle View Post
The log isn't open yet.

1. DataLogCreate
2. DataLogOpen
3. DataLogWrite
4. DataLogClose
5. DataLogDelete (optional)

Set up the DataLogOpen block with the same name and ID as the create block and then it will allow the DataLogWrite block to function.
Do I need to do this?

The F1-help says "Data log opens automatically when you execute the instructions "DataLogCreate" and "DataLogNewFile".
Attached Images
File Type: png DataLogOpen message.png (159.8 KB, 30 views)

Last edited by Mas01; September 18th, 2023 at 10:20 AM.
  Reply With Quote
Old September 18th, 2023, 10:35 AM   #50
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,656
Although I can't see it in the help, I would expect this function to operate asynchronously over several plc cycles - as you are using the first scan bit you may not be giving the function enough time to process your request.
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com
  Reply With Quote
Old September 18th, 2023, 10:45 AM   #51
mk42
Lifetime Supporting Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 3,151
Quote:
Originally Posted by Mas01 View Post
Do I need to do this?

The F1-help says "Data log opens automatically when you execute the instructions "DataLogCreate" and "DataLogNewFile".

My guess is that it might Open automatically when the Create succeeds, but it probably doesn't do anything when the Create fails, such as when the log is already created
  Reply With Quote
Old September 18th, 2023, 11:35 AM   #52
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
Hmm, one good bit of news...Every time the REPORT button is pressed on the HMI, a new row is added to the CSV file...I've counted the button presses and the number of rows in the CSV is the same, and increments accordingly.

Am I writing to the datalog correctly? Hope you can see code in 2nd picture.
Thanks
Attached Images
File Type: jpg csv filled with zeroes and no headers.jpg (307.0 KB, 11 views)
File Type: png Create Open Write commands.png (58.6 KB, 10 views)

Last edited by Mas01; September 18th, 2023 at 12:01 PM.
  Reply With Quote
Old September 18th, 2023, 12:33 PM   #53
Puddle
Member
United Kingdom

Puddle is offline
 
Join Date: Mar 2022
Location: UK - The Norf
Posts: 273
Looks like you’re writing the values to your data area in the DB after you’ve triggered the datalog blocks? Although that should mean that the second time you hit the button, you should get the results from the previous try logged unless you have it zero’d somewhere.

I think you have more trust in that button pressed bit than I would, I prefer to have things sequenced through multiple bits to ensure it executes in the correct order.
  Reply With Quote
Old September 18th, 2023, 12:53 PM   #54
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
Quote:
Originally Posted by Puddle View Post
Looks like you’re writing the values to your data area in the DB after you’ve triggered the datalog blocks? Although that should mean that the second time you hit the button, you should get the results from the previous try logged unless you have it zero’d somewhere.

I think you have more trust in that button pressed bit than I would, I prefer to have things sequenced through multiple bits to ensure it executes in the correct order.
Although that's a single button press on the HMI, there's some logic behind it such that the button will only appear when certain other conditions are satisfied. So there is some "control" behind it.

My main problem right now is why I'm seeing zeros in the CSV.

Question: Does it look to you that I'm writing to the datalog correctly with those MOVE commands? Thanks

Last edited by Mas01; September 18th, 2023 at 01:02 PM.
  Reply With Quote
Old September 18th, 2023, 01:41 PM   #55
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
I'm getting frustrated again - in the report_db which defines each "row" of the CSV, should these be 'Retain' or not? Just wondering if it's got anything to do with why I'm only seeing zeros, when I want the values as they appear in the pictures (monitor mode values).

Thanks
Attached Images
File Type: jpg should these be RETAIN.jpg (279.0 KB, 29 views)
  Reply With Quote
Old September 18th, 2023, 01:57 PM   #56
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 5,485
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.
  Reply With Quote
Old September 18th, 2023, 02:51 PM   #57
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
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.
Good shout.
I'll look into that first thing tomorrow, cheers.
  Reply With Quote
Old September 18th, 2023, 06:16 PM   #58
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,656
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.
Attached Images
File Type: jpg log.jpg (186.3 KB, 26 views)
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com
  Reply With Quote
Old September 18th, 2023, 06:35 PM   #59
Mas01
Member
United Kingdom

Mas01 is offline
 
Join Date: Oct 2020
Location: Leicester, England
Posts: 1,044
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.
In this example, does your CSV file have the headers in? i.e. value1, value2, etc.
Is the data being logged correctly?
Thanks
  Reply With Quote
Old September 19th, 2023, 03:02 AM   #60
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,656
Yes.
Attached Images
File Type: jpg csvlog.jpg (66.0 KB, 21 views)
__________________
S7-300 to 1500 conversions done - email (minus the spam) to spams7conversions@hotmail.com
  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 10:55 AM
Siemens S7/TIA v18: Is there a "first scan" in TIA portal?... Mas01 LIVE PLC Questions And Answers 4 September 1st, 2023 12:29 PM
Siemens S7/TIA v18: What does "Object Number" mean?... Mas01 LIVE PLC Questions And Answers 4 August 31st, 2023 12:41 PM
Siemens S7/TIA v18: Data conversion DTL to DATE...... Mas01 LIVE PLC Questions And Answers 1 August 29th, 2023 10: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 10:45 AM


All times are GMT -4. The time now is 08:27 AM.


.