Jump to content

Saragani

Administrators
  • Content count

    692
  • Joined

  • Last visited

  • Days Won

    66

Saragani last won the day on November 15

Saragani had the most liked content!

Community Reputation

87 Excellent

3 Followers

About Saragani

  • Rank
    R&D Guru

Profile Information

  • Gender
    Not Telling
  1. BSOD in Windows 10

    No, because it is a microsoft driver that comes with Windows (even XP has it).
  2. BSOD in Windows 10

    I can't roll back (System restore and windows.old were deleted by me). I just wonder if other people with the Fall Creators update suffer from the same problem. It looks like a bug in the RNDIS driver that microsoft provide.
  3. BSOD in Windows 10

    Anyone here is using a Windows 10 Fall Creators update? If so, has anyone tried connecting the PLC with USB to PC and when power-up the PLC? Since yesterday, I'm having a strange BSOD when the PLC starts, or when the PLC is updating the OS. This is not a one time crash, and it happens on each time. The BSOD error code is: KERNEL_SECURITY_CHECK_FAILURE Anyone else is having the same issue? (I'm wondering is something for screwed in my Windows, or Microsoft screwed something).
  4. Windows 8.1 invalid class

    Too bad you don't have a screen capture of the error message. I could have looked for it in google and try understanding why it happens. Anyway, there were a lot of people in the past that installed UniLogic on Windows 8 and Windows 8.1. so it is probably something which is not installed, or has a corrupted installation, and it causes the Install script to fail.
  5. order of data tables

    C4 = 196, which is the size of All the Part of project cells + the size of the tables structure (compressed). I assume (didn't check) that if you use Binary Message with Command Code 5, Sub Command 0, Address = Flash Address from Visilogic, and Length (for example 4), then you will get the value of the first offline cell. I did not test it, but I think it should work.
  6. order of data tables

    If you follow the PCOM Protocol pdf, on page 9 you have: Binary Message Format. the first 24 bytes are the Header, and the last 3 bytes are the Footer. The message doesn't have to have a message details. You can see from the messsages I sent that the Data Length (bytes 20-21 in the Header) is 0. The documentation does not specify that Byte 13 in the Header is the subcommand, and that bytes 14-17 is the Address, and that Bytes 18-19 are the Length to read Lets take for example. the second message I sent: Send: 2F 5F 4F 50 4C 43 00 FE 01 00 00 00 05 07 10 00 00 00 C4 00 00 00 65 FC 00 00 5C 05 - Command Code 07- Sub Command 10 00 00 00 - Address (the value is 16) C4 00 - Length (the value is 196) Please reconstruct messages like I did (you don't have to send them to the PLC, just output them) with your code. You must verify that you got the exact same message. If for example, the checksum calculation is wrong, the PLC won't reply. The messages I posted were sent to a real PLC, and the replies I posted were also received from it. It works!
  7. You can copy the 2 16 bits registers (assuming it is an array of 2 Int16) to a Buffer using "Tag to Buffer". (or use 2 Tag to Buffer" elements, but with an offset of 2 on the second copy). Then use a "Buffer to Tag", and copy 4 bytes from offset 0 from the buffer into a Real number. Depending on how the value is sent, you might need to swap bytes on the buffer before copying it to Real.
  8. order of data tables

    Well, I'm guessing that the PLC does not reply to the message. I'm getting the same result Maybe this Command is obsolete, so I'll post another solution (More complicated, but it works). First, execute a Binary message as follows: Address = 0, CommandCode = 5, ElementsCount = 16, If the result is 0 bytes long then the request failed. The TopicLength is an Int32 in offset 4 If the TopicLength is 16 bytes, then it means that there are no tables in the project. Assuming that the TopicLength is more than 16 bytes then TotalLength is result.Len - 16. Assuming that you've got more than 16 bytes then the TotalLength is TopicLength - 16. Now execute another binary request: Address = 16 ElementsCount = TotalLength CommandCode = 5 SubCommand = 7 The TopicBlock is the result of that command. Note: The TotalLength might be a big number, probably larger than 960. The communication buffer size in the PLC is about 960 bytes (it is a little more, but I'm taking some extra bytes so you'll not accidentally hit the limit). If the total number of bytes you need to read (or write in some cases) is larger than the Buffer Size, then you need to split it to several messages. Address must always be Even ElementsCount must always be Even For example, I need to read 2495 bytes, then: First request: Address = 16, ElementsCount = 960 Second request: Address = 976, ElementsCount = 960 Third request: Address = 1936, ElementsCount = 576 (I need 575 bytes, but I read an extra byte) Now that you've got the TopicBlock, then you can take the Part Of Projects data out of it. Inside the TopicBlock, in offset 4, you will get the total size of the Part of project cells (Part of project cells length) In order to get the Part of project cells, you need to take them from the TopicBlock, starting offset 12, and with the length you got (Part of project cells length. If you look in Visilogic, then you will notice that the first Part of project cell in the first table starts with Flash Address 28. Why 28? 16 bytes of header, and then the 12 bytes which is the offset of the first offline cell. But now when you have the values of the offline cells directly, then the first cell starts at offset 0 (So take the offset in Visilogic and subtract 28 from it. This would be the offset in the Part of project cells data that we have). Here is a C# code example using the .Net communication driver. BinaryRequest br = new BinaryRequest() { Address = 0, CommandCode = 5, ElementsCount = 16, }; ReadWriteRequest[] rw = new ReadWriteRequest[] { br }; plc.ReadWrite(ref rw); var header = br.IncomingBuffer; var topicLength = BitConverter.ToInt32(header, 4); var totalDataLength = topicLength - 16; if (totalDataLength % 2 != 0) totalDataLength++; BinaryRequest br = new BinaryRequest() { Address = 16, CommandCode = 5, SubCommand = 7, ElementsCount = totalDataLength, }; ReadWriteRequest[] rw = new ReadWriteRequest[] { br }; plc.ReadWrite(ref rw); var topicBlock = br.IncomingBuffer; int cellsLength = BitConverter.ToInt32(topicBlock, 4); byte[] partOfProjectBlock = new byte[cellsLength]; if (cellsLength > 0) { Array.Copy(topicBlock, 12, partOfProjectBlock, 0, cellsLength); } In my case: the TopicLength is 212, so the Total Length is 196. Here is an example of the messages that were sent to the PLC: Sent: 2F 5F 4F 50 4C 43 00 FE 01 00 00 00 05 00 00 00 00 00 10 00 00 00 30 FD 00 00 5C Received: 2F 5F 4F 50 4C 43 FE 00 01 00 00 00 85 64 00 00 00 00 10 00 10 00 3C FC 44 42 64 FF D4 00 00 00 FF FF FF FF FF FF FF FF 4B F5 5C Send: 2F 5F 4F 50 4C 43 00 FE 01 00 00 00 05 07 10 00 00 00 C4 00 00 00 65 FC 00 00 5C Received: 2F 5F 4F 50 4C 43 FE 00 01 00 00 00 85 64 10 00 00 00 C4 00 C4 00 C4 FA 91 B9 32 ED 3C 00 00 00 7C 00 00 00 01 00 05 00 09 00 02 00 06 00 0A 00 03 00 07 00 0B 00 04 00 08 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 63 94 60 CC 61 98 B8 D3 E8 2D 03 1F 03 17 23 17 03 23 03 17 03 03 03 13 10 32 42 D9 8C 40 CC D0 F0 FF FF FF 7A 06 B8 0C 13 48 9C 11 9B 0C 33 4E 3D 2C 38 65 58 71 CA B0 E1 94 61 C7 E9 02 0E 9C 7A 38 71 EA E1 C2 D0 C3 18 92 98 94 93 AA 60 C8 E0 9C 9F 53 9A 9B A7 60 C0 00 63 19 C2 59 46 70 96 31 9C 65 02 67 99 C2 59 66 70 96 39 9C 65 01 67 59 32 30 00 00 88 49 00 CD 00 E1 C8 5C
  9. order of data tables

    I must look at the source code in order to know better.
  10. Array or a table

    A loop won't help, since you will still overwrite outputs 0 to 3. Please talk with out support tomorrow, or when ever you can. I'm sure that after they understand what you're trying to accomplish, then they will find a solution. If you want that on time X, the valves will be opened using Combo Box 1 In time X + 1 sec, the valves will be opened using Combo Box 2 In time X + 2 secs, the valves will be opened using Combo Box 3 In time X + 3 secs, the valves will be opened using Combo Box 4 (the same 16 valves) Then maybe it is better using a Timer with 1 second (and not idle), and after each timer tick, increment an index. You can then use "Load from Array" element, in order to load a specific value from the SelectedValveAlign (by index), and use that value (Load from Array will store the value into Valve_Selection) and the rest of the code remain as it is right now.
  11. order of data tables

    Well, you probably know that Read Data Table is using Command number 4, and write Data Table is using command number 68. If you use command number 75, then you can read the part of project data tables. I think that the "Number of bytes in the entire row of the Data Table." in this case is the size of the Part of projects row (You can look in Visilogic for the offset in Flash of 2 consecutive rows... Look at the offset in each row of a part of project cell. This should give you the size of a part of project row).... This is off course if you want to read a specific column, and not the entire part of project cells, which in this case, the"Row Size" is the same, bug the number of bytes to read in each row has the same value.
  12. Array or a table

    I'm not seeing the entire expression in the tags inputs, so I'm not sure, but aren't you overwriting outputs 0 to 3, so the last rung wins? The code that I assume is running is: If (start) then NumToBits(SelectedVaalvesAlign[0]. Valve_Selection), And Then CopyArray(ValveSelection, 0, 4, Outputs, 0) If (start) then NumToBits(SelectedVaalvesAlign[1]. Valve_Selection), And Then CopyArray(ValveSelection, 0, 4, Outputs, 0) If (start) then NumToBits(SelectedVaalvesAlign[2]. Valve_Selection), And Then CopyArray(ValveSelection, 0, 4, Outputs, 0) If (start) then NumToBits(SelectedVaalvesAlign[3]. Valve_Selection), And Then CopyArray(ValveSelection, 0, 4, Outputs, 0) So if I understood correctly, Outputs 0 to 3 are being overwritten by the last rung. I assume that you have 16 valves. And each combo-Box contains 16 options , which are mapped to 16 bits. You are trying in this case to map 64 bits (16*4) into 16 bits. Is there any chance of getting the project, so I'll be able to read it better? (You can send it to support@unitronics.com and ask them to forward it to me). You can call the support by phone and explain them in words what you are trying to achieve (And I'm sure it will be easier to explain it and understand what they suggest). Maybe the idea of 4 ComboBoxes is faulted (Maybe you need 16 checkboxes).
  13. RS485 CPU COM PORT...2 instead of 1?

    Yes, there is an issue with 1.21.51, and it will be fixed in the next version. If you need a project to be fixed, then you can send it to our support.
  14. BSOD in Windows 10

    Try again. I'm not aware of any issue like that, and I'm regularly opening projects with double click.
  15. order of data tables

    If you are using the the Data Tables .net DLL, then it is easy.
×