Scripting for dummies


silogarrett

Recommended Posts

The chapter on scripting in the help goes over it step by step, but it isn't terribly detailed. If you learn by example, check out all the forum posts. Otherwise I would just get any basic programming book that uses a structured language like C, VB, or Pascal. HTML is not a programming language, but php, java and javascript are. Just skip most of the stuff about objects and anything that relates to the development environment.

Also, you can do a lot of stuff without scripting. What are you trying to do?

Link to comment
Share on other sites

I'm developing a user interface for a conveyor-based system for analyzing radioactive soil. It has a number of inputs (12 channels of count data, a strain gauge, a digital counter that runs off of belt movement, and two conveyors that will be computer controlled through DF) - but I think once I have the data coming in it may get simpler.

All this is mocked up in the attached CTL. It's about half done, but I'm stubbing my toe on the simple things like timers and progress bars, and the sequences needed to run them. I still don't understand variables, really, and so I'm using V channels...

Your input would be most valuable. Can you keep the CTL off the forum please?

Mike

Link to comment
Share on other sites

As you say, once real data comes in, things will get easier. What is required depends a bit on the hardware and what sort of logic you need to implement. Once you know that, there are a number of examples on this forum and in the help.

Your page designs are really quite good. To be blunt, its obvious that you have the design gene, but perhaps not the programming gene. If variables really throw you, you might consider either hiring a DF expert, or just hire a programmer right out of school who should be able to learn the scripting in a day (assuming they actually have the programming gene). That's one of the main reasons we chose to use scripting rather than flow charts (which are not very flexible) or on-screen wiring: you can hire any one of the millions who has done programming in VB, C, Java, PhP, or any of a thousand other languages and they can learn the DF script quickly.

It is, however, hard to find people that can design good HMI screens...

BTW: you don't want to put () around your +. Its just, for example: Chan6[0]*100+37.22

Link to comment
Share on other sites

Thank you for your kind comments. I'm going to give it a go in spite of being genetically challenged - DF is perfect for the application - and has too much going for it for me to change now.

Hopefully, I can prevail upon you for assistance. Really, I think I can figure most of it out. I've taken your advice and am poring over many books on scripting. Array creation will be my biggest hurdle, I think - I need to get Channel 1 thru 11 and the Background channel into a fixed-length 2D array, where I can do things such as average the values, and most importantly, create a Indian Blanket-type moving graph of the data.

I'll scour the forum for all I can learn.

Thanks again!

Mike

Link to comment
Share on other sites

I definitely wasn't recommending switching off DF. For an application such as your, some scripting is going to be required no matter what tool you use. If you are going to learn scripting, DF is probably the best choice as most things are quite immediate so its much easier to see what is happening than other languages. Feel free to post questions as they come up.

And don't take it personally, what you may lack in programming skill (and you'll probably prove me wrong), you definitely make up for in design skill, something that is much harder to find.

Link to comment
Share on other sites

  • 8 months later...

Its our own. Its more like C syntax except the use of endif, endwhile, etc for blocking. However, if you have done VB, C or really any other normal structured text programing language you will not have any problem picking up DAQFactory scripting. Even non-programmers are able to make good headway on it, especially since you can do so much without any scripting, and a lot more with just a few lines of script here and there.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.