Jump to content

Saving trend to SD card and changing filename


Recommended Posts

Hi guys,

I'm new to PLC programming and have no knowledge about it except what I've learned in a few days. I was programming in Pascal and C+ 30 years ago and this PLC logic is breaking my brain.

If anybody can help me please? I have a program that works and all I need is to implement saving trend to SD card every time an button is pressed and it stops saving when button is pressed again.

Every time button to stop saving trend saving should be stopped and file name renamed to date+time.usd. I thing that would be nice for later checking temperatures for inspection of the process.

I created button, file for trend, SD card is formatted. Trend is working, I can see it that it is functional.

There's only one curve in one trend.

Probably I took wrong path and my logic is flawed.

Im using VisiLogic 9.8.65, Vision V430 and SD Card Suite

Edit:

I forgot to write what is the problem :)

Filename is not correct. I is part of original name and some numbers.

With SD Card Explorer mostly I don't see new files. And it won't backup complete SD card but only first folder (SYSTEM) or maybe five of them. Yesterday it saved whole SD card and now it only saves few parts. I restarted everything but nothing.

naziv-trenda.jpg

MB 28 is from button.

snimanje-trenda.jpg

Thanks in advance!

Link to comment
Share on other sites

  • MVP 2023

HI Dragec, a quick look at this is all I could do and perhaps the magic thing that you might not have learnt yet is Set/Reset on MBs.  You can Set a MB to stay on until you Reset it.

The other thing to keep in mind is that SD card actions take far longer than you might be expecting.  You need to allow time for something to finish by having logic in your program that acts according to the various flags that turn on/off during different SD actions.

No doubt others on the forum will chime in soon explaining that you should get rid of all your previous programming notions.  That way you won't break your brain, just learn new stuff!

cheers, Aus

Link to comment
Share on other sites

Thanks Ausman

I still can't do it to work like I would like to.

I need to record process (trend) for 3-4 hours (every 2 minutes). Sometimes it can be two times a day, sometime only once per day. And I need this record for one year. Maybe 6 months if it is impossible to record for whole year.

I'm trying to save Trend to SD and filename needs to be date+time whenever user presses button. Is it even possible to do?

Do I need to close file before opening new file with new filename?

Maybe there is some example that would open my eyes?

 

 

Link to comment
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...