Jump to content

Saragani

Members
  • Posts

    1,195
  • Joined

  • Last visited

  • Days Won

    116

Everything posted by Saragani

  1. Why you say I can't have Images inside the post Cara? I can click on Browse and add Attachment. Then after the attachment was added, it has on it's right side "Add to Post". Here I click it: And now I continue to write some stuff. I can then add another Image, add it to post: And then continue writing. No need to go directly to gallery. (We do have to add it as attachment, but thats the only way to do it).
  2. People who see the SD Card Explorer in action usually sometimes wish to have the same functionality in their own application.Some of them contact Unitronics in order to get some details on the protocol, or ways that they can do the same, while others fear from the worst: that it's a lot of work.I know very few people that will be happy to write the whole protocol by themselves.The only guy I can think of in that matter is Ash Nielson... I have no idea where he gets his strength and energy from, but the solution for this problem is actually simpler than you think.You don't have to be energetic as Ash in order to write your own SD Card Explorer because the .Net communication driver actually contains all the logic If you don't know what the .Net communication driver, then please refer to the Downloads section on the main website (not the forum) it has some examples + the source code of the .Net communication driver.For those of you who does know how to work with it, I can assume that you are already familiar with the all mighty and magical PLC object.Within the PLC object, hides a small sub class called SD.This class gives all the capabilities of reading and writing files and also listing directories and deleting files.So how do we get started:Lets assume that we have a Serial port called serialLets create a PLC object:PLC plc = PLCFactory.GetPLC(serial, 0);All the code that I will write will be in C#, but the syntax in VB.net is not much different.Now that we have a PLC object called plc, we can access it's SD Class.Please note that SD capabilities are only available to the Enhanced PLCs (V570/V130/V350).Before I give any more code examples, I'll list the Public functions inside the SD Class:public Folder Dir(ProgressStatusChangedDelegate del)Returns a Dir of all Folders and files in the SD (Dirs the Root). ProgressStatusChanged is being used to return the Status, Pecentage and Action of the current Statuspublic Folder Dir(SdFolder sdFolder, string filesExtension, bool scanSubFolders, ProgressStatusChangedDelegate del)Requests Dir Syncrhronously. Accepts SdFolder enum as the path to list, extension for example "*.*", and some other paremeterspublic Folder Dir(string folderName, string filesExtension, bool scanSubFolders, ProgressStatusChangedDelegate del)Requests Dir Syncrhronously. Same as above, but path is string and not enumpublic byte[] ReadFile(string folderName, string fileName, ProgressStatusChangedDelegate del)Read File Syncrhronously. Reads the whole file from SD and then returns it's content as Byte Arraypublic byte[] ReadFile(SdFolder sdFolder, string fileName, ProgressStatusChangedDelegate del)Read File Syncrhronously. Reads the whole file from SD and then returns it's content as Byte Array.Gets SdFolder as path instead of stringpublic void ReadFile(string sourceFolderName, string sourceFileName, string targetFolder, bool resumeRead, ProgressStatusChangedDelegate del)Read File Syncrhronously. Reads the file and each chunk that is being read is instantly written into diskpublic void WriteFile(SdFolder sdFolder, string fileName, byte[] fileContent, ProgressStatusChangedDelegate del)Write File Syncrhronously. Since we only allow writing files into Authorized folders only then this function only accepts SdFolder enum as path and not as stringpublic void DeleteFile(string folderName, string fileName, ProgressStatusChangedDelegate del)Deletes a file... DUHH!!! (Sorry, I had to do that)public void DeleteFile(SdFolder sdFolder, string fileName, ProgressStatusChangedDelegate del)Same as above, but with SdFolder enum as pathAlso consider using:public static string GetSdFolderAsString(SdFolder sdFolder)and the opposite function:public static SdFolder GetSdFolderFromString(string path)Coming up next... Real code. SD Card Explorer Code revealed.Come back to our next episode next week
  3. Another thing you can try is going to: C:\Documents and Settings\YOUR_USER_NAME\Local Settings\Application Data\Unitronics You should see there folders in names like: Remote_Operator.exe_Url_h24lo2y04scc1aib0blupoaazuuwi33u if Delete those folders, it will clear your "project to open when Remote Operator starts" which is what happens when you start Remote Operator.
  4. Are you sure you have deleted the "Remote Operator" folder? Search for a file called "Recent Projects.xml" and delete it.
  5. Hi, 1) Please uninstall Remote Operator, then go to C:\Program Files\Unitronics\Remote Operator\ and Archive (Zip) it's content to a file. 2) Place the file somewhere safe (Like desktop). 3) Delete the Remote Operator Folder. 4) Install Remote Operator again. 5) If the problem is solved then attach the Zip file to this thread. If the forum doesn't allow you to attach it (for example because the file is too big) then email it to Unitronics Support and ask them to forward it to Saragani with a reference to this thread (so I'll know what the mail is about). 6) If the problem was notsolved then post here again saying that you still get the "Root Element is Missing" and I'll see how we can continue with the debug. Btw, does the error happens when you try to save a specific UR2 file (for example you opened a UR2 file, made some changes and then saved it)? Or does the error happens no matter what you try to save (even a new project)? Thanks
  6. My first guess would be Unitronics Developers FootBall. Cara, am I right?
  7. No, it probably happens because the text has a transparent background.
  8. OK, problem is solved. msjro.dll was for some reason not registered. If this problem happens to you again (because of a system crash or what ever), go to C:\Program Files\Common Files\System\ado\ Find the file msjro.dll, double click on it, and select to open it by a program you browse for... Open it with RegSvr32 which is located on c:\Windows\System32 Thank you for your patience.
  9. Hi, I can't be sure what exactly is wrong in your computer since the guy that remotely connected your PC is currently not here, so as a last resort I can try to remote control your PC to find out the source of the problem. Right now I'll try guessing what could be the problem. 1) Search in your computer for a file called: dsofile.dll 2) If the file doesn't exist then tell us 3) If the file exists then try to register it with RegSvr32 According to http://vbcity.com/forums/t/150532.aspx , you might be missing some VBScript DLLs. Maybe in this case the missing files are related to the FileSystemObject... You can try checking that by creating a new V120 project and Converting it to a V130 project. (It should use the FileSystemObject and if it also fails with the same error then it might indicate that the missing files are related to the FileSystemObject).
×
×
  • Create New...