gecko
Hello,
what does this error message mean? where and what do I have to look for?

Program compiled successfully
moving files...
error moving files
Reply 0 0
thiagoralves
This error means that your project doesn't have a resource or a configuration:  http://www.openplcproject.com/reference-your-first-project
Reply 0 0
gecko
Hey you started with tutorials :-)

I don't know exactly what happened but instead of creating a new project, I wrote the same again as a second program in Hello_World than it was ok. also after deleting Hello World. I get forward step by step.

At the moment I experiment with global Variables and I try to get the difference between function and functionblock. I worked than with functionblock.
DzBlockintern.png  DzBlockoutput.png 
(all the other Variables  are declared External)
  
This is in the functionblock. I tried to declare it as External, and put the lamp in the functionblock, but then the lamp was not going. now its an output and the next two screenshots are from the main program:

DZMain.pngDzLamp.png 
(I also had a lamp parallel to DZ0 that was working)
now it is working. So I learned, that any output I have to have in the program. Is that right?

Its hard to explain so I hope you can get the idea.
Reply 0 0
thiagoralves
gecko wrote:
Hey you started with tutorials :-)


Yes I did =) I'm slowly adding documentation to the website so that people that never played with PLCs before can get started on the platform.

Now, I don't know exactly what you're trying to accomplish, but maybe some theory would be helpful. Functions and FunctionBlocks are distinct things on PLC programming. If you're familiar with object-oriented programming languages for PCs, like Java, C#, C++, etc, you can think of a PLC Function as a function on a normal C++ program. It will be called to do its thing, and then exit. Sometimes it can even return a value. For example, you can define a PLC Function to add two numbers. This is just a simple operation. It doesn't need to know anything about the numbers, just need to get the values, add them, and then return with an answer. A FunctionBlock is like a class, where the objects are called instances. The difference between a function and a class is that the class can have internal memory and can keep track of it. For example, you cannot create a Timer block using a Function, you need it to be a FunctionBlock, so it can keep track of its own time. If you have 3 timers in your program, each one of them might be on a different count, and that's fine, because each one of them is an instance of the Timer class and has its own internal values. A Function cannot keep internal variables. Every time a Function is called, it must do the same thing. A FunctionBlock can do different things each time it is called because its internal values can change from one time to the other. Those are two great references if you want to learn more about Function and FunctionBlocks

https://www.dmcinfo.com/latest-thinking/blog/id/117/iec-61131-3-function-blocks--unleash-the-power
http://ua.automation.com/resources-tools/application-stories/programmable-logic-controller-plc/iec-61131-3-functions-and-function-blocks-what-is-the-difference

About your question on how to setup global variables and how to create multiple programs inside the same project, this might help you out:  https://openplc.discussion.community/post/how-to-create-two-programs-in-one-project-using-plcopen-editor-9644717?highlight=global&pid=1303199720
Reply 0 0
gecko
Thank you! that was very helpfull :-)
Reply 0 0
gecko
this
"error moving files" is a strange thing... I got it again when I tried to make a new Program. when I put the same thing in the Hello World an delete the Hello world parts everything is fine. so at the moment I do it that way... may be I will find  the reason later...
Reply 0 0
thiagoralves
The reason is precisely because you haven’t created a configuration and a resource for your program or had named them wrong. I need to fix that error message to make it look less generic. Read that tutorial about creating your first program and you’ll understand it better
Reply 0 0
Reply