Jump to content

Saragani

Members
  • Posts

    1,195
  • Joined

  • Last visited

  • Days Won

    116

Everything posted by Saragani

  1. The documentation is outdated. The SaveToUDT accepts only 1 paremeter, which is the filename (it takes all the tables and saves them to a UDT file). void in c# means that the function does not return anything. In VB.net there is Function and there is Sub (where Sub is a function that does not return any result). You should just call it like: SaveToUDT("c:\hello.udt") No need for Public or void...
  2. Is the SaveToUDT a function you wrote? (Because the only SaveToUDT function I know, accepts one parameter, which is a file path). The SaveToUDT I know is written in C#, which is a .Net languages (the whole .Net communication driver and then Data Tables DLLs are written in .Net), and it compiles to IL code (So it doesn't matter if you use C# or VB.Net... You can use those DLLs). I'm not sure I understand the question.
  3. Hi, as I wrote in the other thread you are replying to, the function gets 4 parameters, not 3. public void WriteFile(SdFolder sdFolder, string fileName, byte[] fileContent, ProgressStatusChangedDelegate del) The first parameter is the folder the second one is the filename inside the plc (the target filename) the third parameter is the content of the file (byte array... You should read the content of the original file) The 4th parameter is the progress delegate. (which can be null) in VB.Net (and vb6) null is called Nothing. Here is an example of a demo code: Dim serial As Unitronics.ComDriver.Serial Dim plc As Unitronics.ComDriver.PLC Dim fileContent As Byte() fileContent = System.IO.File.ReadAllBytes("c:\Temp\Test.udt") serial = New Unitronics.ComDriver.Serial(Unitronics.ComDriver.SerialPortNames.COM1, Unitronics.ComDriver.BaudRate.BR115200) plc = PLCFactory.GetPLC(serial, 9) plc.SD.WriteFile(SD.SdFolder.EXCEL_EXCEL1, "test123.udt", fileContent, Nothing)
  4. Yes, it doesn't care what file is it, as long it follows the 8.3 filename standard. You can write your own SaveToUDT that will save to file and then upload it the SD. You might also be able to write an extension method. This will allow you to do (where dtverzenden is the Unitronics Data Table object): dtverzenden.UploadToSD(Sdfolder.EXCEL_EXCEL1, sDateTimePicker)
  5. Hi, it can write more than 1 byte. The function signature is: public void WriteFile(SdFolder sdFolder, string fileName, byte[] fileContent, ProgressStatusChangedDelegate del) The first parameter is the folder the second one is the filename inside the plc (the target filename) the third parameter is the content of the file (byte array... You should read the content of the original file) The 4th parameter is the progress delegate.
  6. There is no SD.WriteXml, since the communication driver doesn't care which file you write. the SdFolder is an enum that tells the PLC to write to the specific folder EXCEL\EXCEL1. The null in this case is a delegate you give it in order to get progress updates. If the WriteFile doesn't throw any exception, then the file transfer was a success. You can read back the file (if you want) using ReadFile and validate its content. The ReadFile and WriteFile also have an overload that accepts a path instead of an enum for the folder //EDIT: Btw, the filenames must be 8.3 compliant (meaning no more than 8 characters to the filenamee and 3 characters for the extension)
  7. I'm not able to find the documentation I wrote few years ago about the SD Class, but, I've found some old information on the forum: http://forum.unitronics.com/index.php?/topic/2630-alarms-from-sd-card/?hl=readfile#entry9117
  8. I've mentioned the .Net communication driver and its SD capabilities, since it gives you the ability to read and write files to the SD.\ This is what the SD Card Explorer uses. The SD Card Explorer is just a UI wrapper that manages things (like listing the files, handling the transfers and showing progress bars). The true API is inside the driver. After you have a plc object (follow the .Net communication driver manual and examples, if you don't know how), that plc object has an SD property with a readfile and writefile methods, for example: plc.SD.ReadFile(.....
  9. You can use the .Net communication driver nad its SD Capabilities in order to read a file from the PLC.
  10. I did not understand if there is a question here... Anyhow, Which DLL zip are you referring? (The .net Communication driver?). If so, yes, you can write directly to operands. And the example I have you yesterday shows how you can write directly to Data Tables.
  11. Hi. Writing your own "Data Tables Editor" is simple. It uses the engine of the Data Tables DLL, and links a UI to it. (I think that one of the examples of that DLL is a viewer or an editor). If you say that you have only 3 or 4 fields (is it just one row?), then you can make a simple UI by yourself, and put the values in the Data Tables.
  12. Hi, Version 1.9 has been released. You can find it under the downloads section: http://www.unitronics.com/support/downloads
  13. Hi, here is a small example. The V130 demo application will configure the Ethernet card to a specific IP (please change it to match your configuration), and when pressing F1, it will establish a connection to the PC (please also change the IP it connects to) to port 1234. The .Net demo application listens to port 1234, and on connect it reads SDW9 and looks for a file with that name. The Vision project contains 2 tables on the Data Tables, and I only write the values to the second table (to simulate a real project, were you only want to write values of a specific table). You can also change the write, so it will write specific rows and columns (range). Please don't forget to change the name of the FDT according to the unique ID of your PLC. You can edit the content of the FDT using "Data Tables Editor" program in the "SD Card Suite" (which can be found on our website). Demo DT Project.vlp .Net DT Example.zip
  14. Ok. I'm not sure if you know what the Data Tables in the Vision PLCs is, but it is totally different from the .Net Data Tables, so I don't know why you are working with the .Net Data Sets and Data Tables. The .Net driver is just a gateway. It has a support of writing and reading from the Vision Data Tables, but the API is not easy to work with (it implements, more or less, the same API as the ActiveX communication driver). The Data Tables DLL was created for giving an easy way of connecting a PLC and reading its data tables (and then changing values, if needed), and also open UDT and FDT files. The Data Tables DLL uses the .Net communication driver for talking to the PLC. As for what the Vision Data Tables is: It is a block of memory divided into areas, which each area represents a table with a certaion struct. Each table has a specific struct given by the programmer. You can look at it as an array of structs, meaning it has X rows, were each row hsa the same structure. You cannot add rows in runtime, and you choose which row you read and write to. I don't know what exactly you are trying to accomplish, but if the Vision Data Tables is good for you then I would: * Create an FDT from the PLC Data Tables (Read the data tables, and save it as FDT). * Let the user edit the FDT file (When opening the FDT with the Data Tables DLL, then you can edit each cell. We have an example of it), and then save it. If you are designing the program, then you can choose which table from the FDT to show in the editor (because some of the tables might be for the PLC use for other purposes). * I would then use the .Net driver for opening a Listener (You might wanna use a ListenerServer that can accept several connections on the same port). * When a connection is being received, read SDW9 (Which is the Unique ID if the PLC) and see if that PLC has any job (this way you can be generic, you can name your files with the ID and time&date and then when a PLC connects, check for a file with a matching name) * Then write that table back to the PLC, and raise a bit (for example, MB1234) to notify the PLC that the Data Tables write is done, and that it has a new job I'm not sure how much data you want to write to the PLC. If it is very small, then you can just use the .Net communication driver without any data tables, and directly writing into Operands.
  15. The PLC cannot read CSV or XML files. I'll look further into the code in order to help yoou with what you want, but basically, the "Save as XML" feature in the Data Tables DLL is just meant for being able to save and load the data to/from the file in the PC.
  16. Hi, can you please close UniLogic, and then kill (from the task manager) the process "Unitronics.Notifier.exe" ? After that, start UniLogic again and try to re-communicate with the PLC. Does it work? If not, can you restart the PLC and try again? Did it help? If both failed, please let us know, and we will try to find the reason.
  17. You can also apply a style of an element to other elements. For example. you have created a red button, and all the other buttons on the screen are blue. Select all the buttons that you want to make red, including the red button as well. Right click the red button, and choose "Apply layout to all selected Button elements", and then both buttons will have the same style. This feature also copies foregound color of texts, etc. The problem with placing an element outside of the screen has been fixed in version 1.9 (Soon to be released).. The issue with the color selector will be fixed on later versions (Instead of canceling the color when the user exits, the "Apply" button will become a "Cancel" button). The border issue has been fixed in version 1.9
  18. Peter, you can also use Remote Operator (which an improved version of Remote Access written in .Net). 1) There is a chance that you will not get an error with Remote Operator 2) Remote Operator has a built in function that creates a screen capture (to clipboard or to file)
  19. No, we don't support code as I've suggested. This was more of a psuedo code.
  20. You cannot save or load more than 1 data table at the same time. Here is how I would do it: Assuming I have 3 data tables I want to load from file on initial cycle (well, none of them will be loaded in the inicial cycle, but the progress would start on the initial cycle) On the initial cycle, I would set 1 bit and reset an int8 which would be used for the status (the output of the load DTI utility). Then I have the code for the first table: When (Bit1 && Status != 1) { Reset Bit1 Load_DTI(table1) Set Bit2 } I will have a similar code for the rest of the tables: When (Bit2 && Status != 1) { Reset Bit2 Load_DTI(table2) Set Bit3 } When (Bit3 && Status != 1) { Reset Bit3 Load_DTI(table3) } That way, I'm sequencing the data tables loading.
  21. Currently not. The Liniear/Circular Gauge Min/Max and Ranges are static.
  22. Int32/Uint32 and Read are currently not supported (This is why you can't selected the Input hight/low), You can copy the values of the input hight/low via ladder into a 16 bit tag and link in to the gauge/meter.
  23. You can create a struct that contains the information structure that you want to pass to the UDFB. It is more logical to pass a struct with 50 members other than passing 50 inputs. Think of how the ladder element that accepts the 50 inputs will look like. it will start at the benining of the screen, and you would have to scroll few pages down in order to see its end.
×
×
  • Create New...