Jump to content

Saragani

Administrators
  • Posts

    1,194
  • Joined

  • Last visited

  • Days Won

    116

Everything posted by Saragani

  1. You will need to have a code in your Ladder that will change the password (So you must change the code in your PLC for that), something like: The password can be 8 to 16 characters, and since each character takes 1 byte, and MI is Int16 (2 bytes) then 8 MIs should be reserved for the password (max length). I would also take 1 extra MI (for null termination. I'm not sure if it's needed), so in this case, you need to make sure that MIs 100 to 108 are not in use by anything else in your project, but for password. Then you need to write the password to your PLC var password = "MyPassword"; // Must be english only characters (can also contain numbers). No hebrew or any other language short[] passwordValues = new short[8]; Buffer.BlockCopy(ASCIIEncoding.ASCII.GetBytes(password), 0, passwordValues, 0, password.Length); var rw = new ReadWriteRequest[1]; var wo = new WriteOperands() { NumberOfOperands = 8, OperandType = OperandTypes.MI, StartAddress = 100, // The Ethernet Password Offset Values = passwordValues.Cast<object>().ToArray(), }; rw[0] = wo; plc.ReadWrite(ref rw); And then, after the Write Operands request succeeds, then you set the Set password bit (MB 0), by: rw = new ReadWriteRequest[1]; wo = new WriteOperands() { NumberOfOperands = 1, OperandType = OperandTypes.MB, StartAddress = 0, // Set password Bit offset Values = new object[] { 1 }, }; rw[0] = wo; plc.ReadWrite(ref rw); I did not test this code. You should have an accessible screen in your HMI were you can set the password to MI 100 from there, and also set bit MB 0 by pressing a button, so just in case something went wrong and you can't communicate with the PLC (for example, a bug in your code, or unknown password that was set to PLC), then you could restore password and communication.
  2. Probably only physically with Ladder or using "Info". If you need to access the PLC, then don't block it. If you are just setting the data to the Ethernet Password Offset without re-calling the Set PCOM Password, then it won't affect. The password is copied from the Ethernet Password Offset to another location in RAM, so it won't be tampered while PLC is doing some manipulations on the operands.
  3. The images that this element is using are not located on the external SD, so you can't, and once the image was loaded by the Screen, it's cached in memory. There is another option you can use: FTP Image. You need to use RAM FTP server, and you link it to the element, and you can upload images to the external SD, and then change the Image file name (it's a string tag) to the new image file name
  4. No, you cannot change it only for a session. The only way to change it is using the Ladder. You can have a code in your ladder that checks for a specific bit, and then the bit is set (Normally open contact), then reset the bit and then call Set PCOM Password ladder element. The Set PCOM Password ladder element is working on a vector of MIs or XIs, so if you know which MIs (or XIs) you are using as the password, then you can first use the communication driver in order to set them, and only then set the bit that sets the PLC password, then you will be able to change the password. Please note that once Set PCOM Password is called, then session will become protected again, and it will not communicate with your program until you either close the socket, or actively call ethernet.CheckPlcPassword(); Since your cached password will now be incorrect, then you will get a ComDriveUnauthorizedAccessException. You should handle it and ask for the new password from the user, or set it (if you know its value) on the ethernet object.
  5. No, you can't affect the password inside the PLC with the API. It must be done from the Ladder code. Password Storage is for caching the password. When the password is correct, then it's being automatically saved in the storage for the specific PLC. The default password storage is RAM storage, which means that it's being deleted when you close your application. The communication driver also supports an SQLite password storage out of the box, so you can use it and it will keep the password encrypted inside the SQLite DB, and will retain it after you close your app.
  6. I'm not sure what's causing this problem. I've recompiled both dlls together again. See if it makes any difference when using the recompiled ones. Also make sure that your project is compiled with .Net 4.7.2 or newer Recompiled.zip
  7. Sure. Update me if it works. Unitronics.RemoteOperator.zip
  8. Hi, The project might have been opened on a computer were someone have enabled 2 HID devices and attached a tag to the HID device identifier. Please close your UniLogic. Then browse the installation directory and find a file called Unitronics.Shell.UI.exe.config Open this file with a text editor like Notepad or Notepadd++ as Admin (else, windows will not let you save the file) This file is an XML file, on which you will find a section called appSettings. The app settings are wrapped with <appSettings> and </appSettings> Inside that section (You can add a line just before the </appSettings>), add the following: <add key="UsbHidAllowTwoDevices" value="true" /> Save the file and then start your UniLogic. Then open the project and go to the Panel USB Port settings. Now if you check the "Enable USB for HID device", then you should see a new option "Two devices mode": If this option is not checked, then check it, and then you should see the tag assignment "HID device identifier": Clear that assignment, and then you should be able to delete the IO Module
  9. Btw, Status 4 means running. I think it should return to 0 when completed.
  10. Hi, here is the recompiled dlls. This version should be Any CPU Unitronics Communication Driver.zip
  11. I will compile you a newer version of the Unitronics.DataTables dll The old dll was using an old version of the .Net framework, so it cannot reference a new one without being recompiled.
  12. Unfortunately, you cannot have 2 types of lists as an input for a foreach function. I can't think of any solution rather than combining them.
  13. You can get an updated version of the DLL if you install Remote Operator. However, I have fixed and updated few things since then, so here is the latest version. This is the compiled dll (compiled as x86), and it requires .Net 4.7.2 (Unlike the old versions that worked with older .Net frameworks). If you need an Any CPU version, then tell me. The new communication driver references the Unitronics.ComDriver.Security.dll It also references the System.Data.SQLite.dll (which uses the interop dlls under the x86 and x64 folders. You will need those files in the same structure). The SQLite dll allows you to use the built-in SQLitePasswordStorage. You can write your own password storage (like saving it in the registry, saving it into a text file, etc), by just implementing an interface.
  14. Yes, As I missing something? Isn't it what you want to do? 20240331-0503-17.3933096.mp4
  15. No, it just changes the access credentials to the PLC (the program will continue running). After you change it, then every person that will want to communicate with the PLC through UniLogic, will need to know the password.
  16. Currently, you have no way of defining an enum, or defining that a function-in is of type enum.
  17. VisiLogic.exe Hi, I have attacked the exe file of version 9.8.97 It should not ask you to upgrade your project is the changes between 9.8.97 and 9.8.96 are minor (and probably not even in the exe, but with the other DLLs that are in the installation directory), so you should be able to use it without any problem. Please update me if it helped.
  18. Are you sure that the visilogic.exe without the need to "run as admin" that you have is 9.8.96? Who gave you that exe? // Edit: I see that you've wrote that the support gave you the exe and it's of version 9.9, so off course it will ask for upgrade.
  19. You are correct, there isn't a specific command for it in the .Net Driver, but looking at the source code of the ActiveX communication driver, then you can call plc.SendString("RS") I'm not sure what are the return values for each state (run and stop), but the code returns Mid(res, 3, 1), meaning 1 character at the 3rd position, for example, for ABCDEFG, it will return C. Please check and update me if it helped you, and what are the returns strings you get for Run and Stop mode (before and after the Mid / Substring)
  20. Can you try with a different USB stick? I've already encountered problems when the stick had corrupted sectors. I see that you already mentioned that you've tried 2 different sticks, but if both of them of the same brand, then maybe it doesn't like it. @NoamM, your assistance will be welcome (Maybe debug it, or get a verbose log)
  21. There is another DLL called Unitronics.DataTables.dll, which uses the .Net driver. It lets you write and read values from data tables.
  22. @leen It was added to the working plan. You should see this feature in one of the next versions (1.37 or 1.38).
  23. It's not a class, it a delegate (a pointer to a function) where progressStatusChanged should be a function that returns void and gets RequestProgress requestProgress as parameter. Looking at the code, I see that it can handle well progressStatusDelegate being null, so you can just pass null instead.
  24. Yes, it's a known issue on version 1.35.227 The fix to this issue will be included in UniLogic 1.36
×
×
  • Create New...