Hello all,
I am having a couple of issues trying to program an HMI using Crimson 3.0. I am no programmer, but I'm learning as I go and I can't seem to figure out a solution for these two issues:
Issue #1: I have successfully created a recipe system so we can save various machine parameters under a product name (ProductID). When a "save recipe" button is pressed, a new .txt file is created named after the current ProductID tag. Everything worked beautifully during testing, as I simply had the recipe files saved to the main directory on the compact flash card. Now, I have set up a "/RECIPE/" directory, since I also want to be able to save logs in a "/LOGS/" directory, and don't want the recipe lookup to see the other files that might be on the card. Since creating the directory, I have no problem saving the recipe files inside the /RECIPE/ directory, but I cannot figure out how to delete them.
What I want to do is have a "delete current recipe" button, which previously performed: DeleteFile(OpenFile(ProductList.ProductID));. This worked just fine until I started putting files into a directory.
Since the currently loaded recipe file name becomes the "ProductList.ProductID" tag, I want to be able to delete the file whose name is currently loaded.
So, I tried: DeleteFile(OpenFile("/RECIPE/+ProductList.ProductID")); But that's not working, since I think the program believes the "+ProductList.ProductID" is part of the syntax its looking for. But, that's basically what I want the program to do.
Can anyone help me figure out how to have the openfile command look for a file within the /RECIPE/ directory, yet have the file name be variable according to the tag?
Issue #2: I have a calculated value that always results in a decimal value (10.8, 11.6, etc.). These values are in inches, and I would like to have the displayed value rounded to the nearest 0.25 inches, or, at worst, rounded up to the nearest inch. Is there a way to do this via programming? Is there a built in method that I don't know about? What I want is 10.8 to show 11 and 11.4 to show 11.5 (nearest 0.25 is preferred).
Many, many thanks in advance.
Tim
I am having a couple of issues trying to program an HMI using Crimson 3.0. I am no programmer, but I'm learning as I go and I can't seem to figure out a solution for these two issues:
Issue #1: I have successfully created a recipe system so we can save various machine parameters under a product name (ProductID). When a "save recipe" button is pressed, a new .txt file is created named after the current ProductID tag. Everything worked beautifully during testing, as I simply had the recipe files saved to the main directory on the compact flash card. Now, I have set up a "/RECIPE/" directory, since I also want to be able to save logs in a "/LOGS/" directory, and don't want the recipe lookup to see the other files that might be on the card. Since creating the directory, I have no problem saving the recipe files inside the /RECIPE/ directory, but I cannot figure out how to delete them.
What I want to do is have a "delete current recipe" button, which previously performed: DeleteFile(OpenFile(ProductList.ProductID));. This worked just fine until I started putting files into a directory.
Since the currently loaded recipe file name becomes the "ProductList.ProductID" tag, I want to be able to delete the file whose name is currently loaded.
So, I tried: DeleteFile(OpenFile("/RECIPE/+ProductList.ProductID")); But that's not working, since I think the program believes the "+ProductList.ProductID" is part of the syntax its looking for. But, that's basically what I want the program to do.
Can anyone help me figure out how to have the openfile command look for a file within the /RECIPE/ directory, yet have the file name be variable according to the tag?
Issue #2: I have a calculated value that always results in a decimal value (10.8, 11.6, etc.). These values are in inches, and I would like to have the displayed value rounded to the nearest 0.25 inches, or, at worst, rounded up to the nearest inch. Is there a way to do this via programming? Is there a built in method that I don't know about? What I want is 10.8 to show 11 and 11.4 to show 11.5 (nearest 0.25 is preferred).
Many, many thanks in advance.
Tim