Jump to content

Search the Community

Showing results for tags 'Explorer'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Our Community
    • Come on in!
  • News and Announcements
    • New! UniLogic V1.21 - Supports UniStream 5"
    • VisiLogic:9.8.64 - Link to mobile app, Ladder: 2x the Space!
    • New!!! ***** U90 Ladder*****
  • UniStream HMI + PLC Programmable Controllers & UniLogic Software
    • UniStream: Hardware
    • UniLogic Software
    • UniLogic UDFBs
  • Vision, Samba, Jazz and M90 PLC + HMIs & Software
    • Vision & Samba PLC + HMI Controllers & VisiLogic Software
    • Jazz, M91 PLCs and U90Ladder
  • Software Utilities
    • SD Card Suite
    • Remote Operator
    • Remote Access
    • DataXport and DataXls
    • UniDownloader
    • UniOPC
    • UniDDE
  • Utilities for .net and Visual Studio
    • Unitronics PCOM Protocol
    • COM Object ActiveX .dll
    • .NET driver
  • Project Design
    • ...I have a project...what hardware do I need?
  • User Application Stories
    • Just finished a great project?
  • Tips and Tricks
    • Best Programming Practices
    • Tips and Tricks
  • Job Board
    • Projects seeking Programmers
    • Programmers seeking Projects
  • General Discussion
    • We're Listening...
    • The Lounge
  • News and Announcements Copy

Calendars

  • Community Calendar

Blogs

  • Unitronics' Blog: PLCs, HMIs and more
  • Saragani's Blog
  • Simon's Blog
  • Ash Neilson's Blog
  • Joe Tauser's Blog
  • Unitronics en Español
  • Powered by AMPS
  • Alldrives UK's Blog
  • Unitronics, Howman Style
  • PLCNewbie's Blog
  • Telestar Automation Blog
  • Webinars Collection
  • Tim's Corner
  • Blog
  • TELESTAR (Italian)
  • i4 Automation
  • i4 Automation (UK)
  • Unistream UDFB's

Categories

  • From Headquarters: Sample Applications
    • From Headquarters: VisiLogic
    • From Unitronics: U90 Ladder applications
  • User-submitted Applications
    • From Users: VisiLogic applications
    • From Users: U90 Applications

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Categories

  • New Features
  • Other

Found 1 result

  1. Build your own SD Card Explorer

    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
×