Jump to content

Marco G

Members
  • Content Count

    54
  • Joined

  • Last visited

Everything posted by Marco G

  1. Hey, no problem. i'm going to trie to create some MB's where the alarms can be stored into and then read those using readoperands like with the datatable.
  2. I know that they are pretty much the same, but i want to implement a function to check for alarms in a existing vb.net project, and therefore i cant directly copy-paste
  3. Hey, I can't seem to get it copied to .net. I will keep working at it but the example is quite big, so converting it al to .net costs quite some time.. Is it also possible to save the alarms to a datatable? because i think it is possible to read a unitronics datatable in .net.
  4. Thanks, just downloaded the Lite version, it can't be opened in vb 2010 express but wil try opening it with my version of Studio 2013. I found some code somewhere else, but that version of card explorer lite has been written in C. Also, i couldn't find the dll in there, which is included in the .net version(SdcardExplorer.lite.dll)
  5. Yeey, that part works. Just curious btw, is there a .net version of the SD card Explorer example?
  6. Hey, The example posted above is a C# example isn't it? I was wondering if there's also a .net example somewhere.
  7. Edit: Whoohoo, got it; at least for inserting 1 row at the time, now i will figure out how to insert multiple rows. I do already have some ideas of how to do that.
  8. Hmm, i cleared the MI needed(in my case i want to use MI150) but i still get the error. The datatable should be completely empty, it says 0 at all the INT columns and the string column is blank so i should have 250 empty rows in the datatable.
  9. Ah right. Thought so. Thanks, i will ask a collegue about the MI part.
  10. Hey, Thanks. I think there a error though. Dim rw() As ReadWriteRequest = New ReadWriteRequest((1) - 1) {} Dim Read As WriteOperands = New ReadOperands() rw(0) = Read With Read It says writeoperand AND readoperand so that gives a error. When i change the readoperand to writeoperand i get the ComDriveException "Values cannot be Null in a Write Operands request" And if i switch it all to read: "'index' must be non-negative and less than the number of rows in table. I checked the fields, removed fields and tested some things but the fields do have a value(default
  11. Ah right. That makes sense. Sorry, completely new to using operands and PLC's in general, just fresh out of college(well not even, learning a second degree in Business IT on the side)
  12. Hey, I adjusted the code(see below) Right now, it compiles without error but it gives the error: "The number of Operands to read cannot be less than 1" on rw(0) = New ReadOperands plc.ReadWrite(rw) The complete code: Dim rw() As ReadWriteRequest = New ReadWriteRequest((1) - 1) {} rw(0) = New ReadOperands plc.ReadWrite(rw) Dim startRowIndex = Convert.ToInt16(CType(CType(rw(0), ReadOperands).ResponseValues, Object())(0)) table.Rows(startRowIndex).Cells(3).Fields(0).Value = DateTimePicker1.Text 'datum en tijd table.Rows(startRowIndex).Cel
  13. Aah, so i do have to do something with read and writeoperands. I read about it in the PLC .net documentation but thought it was for writing directly to the application. Thanks. I will convert it to .net and see if it works.
  14. Okay... and how can i do that? I thought i already got the pc part working and just needed to change some things in the ladder to make it working like i wanted. Row 0 doesnt have to be renewed, all it has to do is add a extra entry to the plc datatable every time i send 1(or multiple) rows to the plc.
  15. Hello, If i understand you correctly, i have to keep the pc software the same ( table.rows(0).cells(0).fields(0)) and write the ladder in such a way that when it sees that i want to add a entry to the table, it automatically writes it to a new line? Cool. thought it was just me because i couldn't find a solution in vb.net.
  16. Before you close this, i was doing some tests and noticed that it will overwrite row 0 in the plc every time i transfer data to it. Is it possible to have it automatically add a new row every time i want to transfer data to it?
  17. facepalm.. turns out i had the table.write on the wrong place... I had it before the table.rows. Now i can advance, add the other items as new rows in the table and at the date and time at which the row has to be executed. THANKS!
  18. Hmm, then saving to FDT isn't of much use(except the future reference). If i use the table.write() function, do i need to specify only the tablename in it or also the textbox.text values that will fill the table? Because if i use the code i got sofar it won't give me any errors but i have the feeling that it's not doing much either because visilogic shows no data in the datatable. On the plus side, i resolved all the earlier errors. Dim dt As Unitronics.DataTables.DataTables dt = New DataTables(plc, DataTablesReadOptions.StructureAndValues) ' You can also read just th
  19. Okay, savetoUDT(filepath .FDT) gives the same "cannot save into UDT from xml or FDT files" error Will try the table.write() and mess around a bit.
  20. Thanks. I will look into it, the using of a file is prefered, but just to make it easier to look back at the settings previously used. I believe a collegue of mine already has some experience with the Unitronics datatables so he can help me set up a checker so that tasks are executed at a by the user specified date and time. I'm also busy with some other things, but if it worked i'll report it to you.
  21. Hmm, i do indeed got a part where i write to SD, but i thought this code would write directly to the PLC. This is how i have it right now. When i use the part where it save's to the pc first i get a error at the first(bold) savetoUDT statement: dt.SaveToUDT("C:\Voerkar\" & sDateTimePicker & ".udt") ' We can now read the file to a bytes array voor het schrijven naar d eplc Dim fileContent As Byte() fileContent = System.IO.File.ReadAllBytes("c:\Voerkar\" & sDateTimePicker & ".udt") plc.SD.WriteFile(SD.SdFolder.EXCEL_EXCEL
  22. Thanks, that was indeed the problem, i named the table in the plc something else then i did in the code. Now that part works. I thought i did something wrong in the code but couldn't find it. Now it's up to the last part of the inserting to the datatable(i also have a other issue but i think that's related to this one so let's finish this first). I don't get a error, yet when i use visiLogic to read the datatable in the PLC, the inserted data(some numbers) are not there, it's all "0"
  23. Hey there, I've been tweaking around a bit and i got the software i'm writing at the point that it does connect to the plc and reads things like the PLC name, However: When i want to send data to the plc it gets a error: The code where the error occur's: If Not plc Is Nothing Then Dim dt As Unitronics.DataTables.DataTables dt = New DataTables(plc, DataTablesReadOptions.StructureAndValues) ' You can also read just the structure. depending on your needs ' we are working with unitronics data tables, not the .net data tables. those are 2 different
  24. Dim path As String = "c:\voerkar\" & sDateTimePicker & ".udt" ' Create or overwrite the file. Dim fs As FileStream = File.Create(path) fs.Close() Using that code it does create the file, but it wont open in unitronics because it apparently is corrupted. Will work on that.
  25. Thanks I've been busy lately and picking it up again today. I noticed that the savetoudt part doesn't work if you don't use a already created file as filepath(so if c:\Temp\Test.udt doesn't exist, it gives a file doesnt exist error). I'm going to work on fixing that right now, will let you know the results for further reference(and for others)
×
×
  • Create New...