dragec Posted January 31, 2020 Report Share Posted January 31, 2020 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. MB 28 is from button. Thanks in advance! Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted February 1, 2020 MVP 2023 Report Share Posted February 1, 2020 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 More sharing options...
dragec Posted February 3, 2020 Author Report Share Posted February 3, 2020 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 More sharing options...
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