Home
here
Contents
1. o0 0 0 0 0 300 300 WindowsDefaultLocation Normal Misc E Error List Output gRPending Checkins E Find Resuks 1 Ready Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date November 18 2009 Adding a Reference to the CV 5000 NET Library Before you can use the CV 5000 NET Library in your application you must add a reference to it in your code This will allow you to access the properties and methods of the CV 5000 NET Library 1 Inthe Solution Explorer right click on CV5000_Sample_Project and select Add Reference p_Sample_Project LERA a Solution C 5000_CSharp_Sample_Project 1 project a T 2 C S000_CS a O e E Propertie H Build S E Referenc Rebuild e B 7 ron Publish Add Add Reference Add Web Reference a View Class Diagram Set as StartUp Project Debug B Add Solution to Source Control amp cut d Solution Explorer Fl E i X Remove Properties Rename wi C 5000_CSh S z CSharp_S3 Unload Project z A LE l ESEA a J Open Folder in Windows Explorer B Misc EN 3 Project File Bam Properties __hple_Project csproj 2 Click on the browse tab and navigate to the directory where the CV 5000 NET Library was installed The default directory is C Program Files Conquest CV 5000 Net Library Sel
2. displayed to the user and saved to disk This program will use a single camera and a single window Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 1 1 Setting up your Program Date November 18 2009 Launch Visual Studio 2008 and create a new C Forms application by selecting a Visual C project type along with the Windows Forms Application project template NOTE The SDK can be used with any NET language such as VB Net Make sure that the NET Framework is set to 2 0 and give the project the name CV5200_Sample_Project as shown below Then press the OK button to continue New Project Project types Database Reporting Test WCF workflow B Visual C Windows Web Smart Device Office Database Reporting Test WCF workflow 1 Wisnal f4 A v Templates JaA NET Framework 2 0 isual Studio installed templates windows Forms Application EM console Application windows Service Class Library ER Empty Project windows Forms Control Library My Templates Gl Search Online Templates A project for creating an application with a Windows Forms user interface NET Framework 2 0 Name Location Solution Create new Solution C Documents and Settings Conquest My Documents Visual Studio 2008 Projects C 5000_CSharp_Sample_Project a Create directory For
3. str args ASCIIData if args RecMode CVRecMode CVError SetMeasurementData str else if args Port CVPort CVDataPort SetMeasurementData str 11 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date November 18 2009 1 4 3 Setting up the Timer The timer will be the source of triggers to the CV 5000 series device Each time the timer expires it will send a trigger to the CV Double click on the tmrTrigger control to add a handler for the timer event and add the following code to the event private void tmrTrigger_Tick object sender EventArgs e cv5000 Trigger 1 1 4 4 Setting up the Start and Stop Buttons The start and stop buttons on the form will enable and disable the timer on the form Create event handlers by double clicking on the buttons and add the following code to the application private void btnStart_Click object sender EventArgs e Trigger the CV 5000 device now cv5000 Trigger 1 tmrTrigger Interval 5000 tmrTrigger Enabled true private void btnStop_Click object sender EventArgs e tmrTrigger Enabled false 12 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 4 5 Running the Application with the Trigger Data Run the appl
4. field that is updated whenever a significant event has happened The code below shows how to use the CV 5000 NET Library in a thread safe way to update the status field in the application Add the following methods to the form s class Function definition used to update GUI in a threadsafe manner delegate void UpdateStringDelegate string entry Called with an invoke when udating txtStatus in event handler private void UpdateStatus string entry txtStatus Text entry r n txtStatus Text Update status TextBox using invoke private void SetStatus string entry Invoke new UpdateStringDelegate UpdateStatus entry The sSetStatus method uses the delegate method UpdateStringDelegate to call the UpdateStatus method This is necessary because Windows Forms controls are not thread safe As you can see from the code above the updateStringDelegate defines a method signature that can be used with the Invoke Method to update a Windows Forms GUI control and its signature is compatible with the UupdateStatus method To boil the Microsoft tech speak into English what this means is that the UpdateStringDelegate method and the updateStatus method have the same return type in this case none and the same parameter list NOTE See the following article in Microsoft s documentation for more information on this concept http msdn microsoft com en us library system windows forms control invokerequired aspx Use or disclosure of data
5. on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 1 3 5 1 3 6 Date November 18 2009 Closing Connections Before the application shuts down you should close your connection to the CV 5000 To do this the CloseConnection method in the CV 5000 NET Library should be called Add a form closing method to the sample application and add a call to CloseConnection as shown below private void Forml_FormClosing object sender FormClosingEventArgs e cv5000 CloseConnection Running the Application with Connection Events In its present state all the application does is connect to the CV 5000 series device Run the application Since the connect command is in the Form1_Load event handler once you run the program you should see something similar to the image on the left below It may take a second or two for the command port connected text to appear If the application is not able to connect to the CV 5000 series device the error message s shown in the image on the right will appear after several seconds Command port connected nor can not connect to the image port of the remote host Image port connected ror can not connect to remote host If you ran into an error while creating the code in this section Section 2 contains a listing of the code up to this point Use or disclosure of data on this page is subject to t
6. the following methods to the form class delegate void UpdateBitmapDelegate Bitmap bmp Add image to picturebox private void UpdateBitmap Bitmap bmp Bitmap oldBitmap oldBitmap Bitmap picPartImage Image if oldBitmap null Release windows resources oldBitmap Dispose picPartImage Image bmp Update picturebox using invoke private void setBitmap Bitmap bmp Invoke new UpdateBitmapDelegate UpdateBitmap bmp 14 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 5 2 Add Image Data to the Data Received Handler When the data is received we need to call the correct handler based on the type of data being received so add the following code to the end of the DataReceived event handler void cv5000_DataReceived DataEventArgs args string str The data from the CV 5000 is stored in args if args ASCIIData Length gt 30 str args ASCIIData Substring 0 30 else str args ASCIIData if args RecMode CVRecMode CVError SetMeasurementData str else if args Port CVPort CVDataPort SetMeasurementData str if args RecMode CVRecMode TrigImageData args RecMode CVRecMode RegImageBMP args RecMode CVRecMode ScreenCapture setBitmap args Bitmap 15 Use or disclosure of data on this page is subject to t
7. to tmrTrigger Add a TextBox to the form and rename it to txtStatus Set the ReadOnly property and the Multiline property to true Place txtStatus in the bottom right of the form the controls are laid out the form should look similar the following image IstMeasurementD ata ia tmrTrigger Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 1 3 1 3 1 Date November 18 2009 Connecting to the CV 5000 Device In this section we will be adding code to the application the light gray code is code that has already been added to the application either by the windows IDE or in a previous step and is just included to help the user grasp where the code is to be added In this section we will add the code to connect to the CV 5000 device and display the connection status on the screen so the user can see that they are connected This section will also introduce the basic concepts of thread safe programming and handling the events that are raised by the CV 5000 Library The sections that follow will build on these basic concepts to retrieve measurement data and finally an image from the CV 5000 Add CV5000_ Series Namespace amp Create an CV 5000 Library Object Use the using statement to enable access to the CV 5000 library s namespace Before you add the using statement you must have previously added a reference t
8. ConnectionEstablished Triggered when the command port is connected to SetStatus Command port connected void cv5000_ImageConnectionEstablished Triggered when the image port is connected to SetStatus Image port connected void cv5000_ErrorOccurred ErrorOccurredEventArgs args if args ExceptionCaught null MessageBox Show args ErrorMessage args ExceptionCaught ToString j else MessageBox Show args ErrorMessage private void Forml_FormClosing object sender FormClosingEventArgs e 22 November 18 2009 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date November 18 2009 cv5000 CloseConnection private void tmrTrigger_Tick object sender EventArgs e cv5000 Trigger 1 private void btnStart_Click object sender EventArgs e Trigger the CV 5000 device now cv5000 Trigger 1 tmrTrigger Interval 5000 tmrTrigger Enabled true private void btnStop_Click object sender EventArgs e tmrTrigger Enabled false 23 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document
9. Date November 18 2009 C Sample Application for the CV 5000 NET Library Prepared by CONQUEST CONSULTING LLC www conquesisolutions com Copyright 2009 This document contains information which is the property of Conquest Consulting LLC Except for rights expressly granted by contract this document may not in whole or in part be duplicated or disclosed without prior written permission Date November 18 2009 Revision History 2009 11 18 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 C CV 5000 SAMPLE PROGRAM This program will demonstrate the use of the CV 5000 NET Library in a simple program to log measurement data and part images sent from the CV 5000 This example assumes you are familiar with C and Visual Studio 2008 NOTE Before you create the sample program you must set the IP address in the CV 5000 and configure the CV 5000 to output all measurement data and acquired images to be sent via the Ethernet Configuring the CV 5000 is beyond the scope of this document and is not discussed here Please consult your company s IT department and refer to the CV 5000 User s Manual for more information The sample program will be responsible for triggering the CV 5000 every 5 seconds When measurement and image data is received by the CV 5000 via the Ethernet connection it will be
10. ErrorOccurred new CV5000 ErrorOccurredHandler cv5000_ErrorOccurred Connect to the CV 5000 series device Now that the hooks are in place we can add the event handlers Add the following methods to the form s class definition The SetStatus method is defined in the next section void cv5000_ConnectionEstablished Triggered when the command port is connected to SetStatus Command port connected void cv5000_ImageConnectionEstablished Triggered when the image port is connected to SetStatus Image port connected void cv5000_ErrorOccurred ErrorOccurredEventArgs args if args ExceptionCaught null MessageBox Show args ErrorMessage args ExceptionCaught ToString j else MessageBox Show args ErrorMessage 1 3 4 Updating the Status Textbox in a Thread safe Manner The CV 5000 NET Library uses independent threads to poll for data from the CV 5000 device Because of this it is necessary to create your application in a thread safe manner Since Windows forms controls are not thread safe the controls on the form cannot be directly updated from the event handlers in the application Therefore the creation of a thread safe method is required to update any of the controls on the form Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 The sample application has a status
11. MPLETE CODE LISTING using System using System Collections Generic using System ComponentModel using System Data using System Drawing using System Text using System Windows Forms using CV5000_Series namespace CV5000_CSharp_Sample_Project public partial class Forml Form CV5000 cv5000 Delegates defines function used to update GUI threadsafe manner delegate void UpdateStringDelegate string entry delegate void UpdateBitmapDelegate Bitmap bmp public Forml InitializeComponent private void Forml_Load object sender EventArgs e Create an instance of the CV 5000 library cv5000 new CV5000 Set up the CV 5000 I P address and port information cv5000 RemotePort 8500 cv5000 RemoteImagePort 8501 cv5000 RemoteHost 192 168 168 211 cv5000 ConnectionEstablished new CV5000 ConnectionEstablishedHandler cv5000_ConnectionEstablished cv5000 ImageConnectionEstablished new CV5000 ImageConnectionEstablishedHandler cv5000_ImageConnectionEstablished cev5000 ErrorOccurred new CV5000 ErrorOccurredHandler cv5000_ErrorOccurred cv5000 DataReceived new CV5000 DataReceivedHandler cv5000_DataReceived Connect to the CV 5000 series device cv5000 Connect Called with an invoke when udating txtStatus in event handler private void UpdateStatus string entry txtStatus Text entry r n txtStatus Text Update status TextBox using invoke private vo
12. ct 1 J NOTE For the RemoteHost property use the IP address that was configured in the CV 5000 series device being connected to Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 3 3 Creating Event Handlers In the last section you created a connection to the CV 5000 but we do not know whether or not the connection was successful This is because the CV 5000 NET Library communicates with the application through events A complete list of the events is contained in Section 6 2 The sample application will use a subset of these events It is through these events that your application will receive the data and any status information that the CV 5000 returns To set up your code to be able to handle these events you first have to create hooks into the CV 5000 NET Library s events and then you have to create the event handlers in your application Since we want to be able to get feedback from the Connect method we must add these hooks before we connect to the CV 5000 Add the following code to the form s load method as shown below cv5000 RemoteHost 192 168 168 211 cv5000 ConnectionEstablished new CV5000 ConnectionEstablishedHandler cv5000_ConnectionEstablished cv5000 ImageConnectionEstablished new CV5000 ImageConnectionEstablishedHandler cv5000_ImageConnectionEstablished cv5000
13. ect CV5000_Series dll and then click OK Add Reference Add Reference inert COM Projects Browse Recent NET COM Projects Browse Recent Look in G9 CV 5000 Net Library Look in G9 CV 5000 Net Library D My Recent Documents f Desktop My Documents 5 My Computer lt gt HD C Program Files Conquest c CV 5000 Net Library OFFICE12 E CW_Palm_9 3 F LaCie G Filename Gag Shared Documents My Documents Files of ty _ E Normals Documents My Network Places Flash Backups Shcvsor p Filename CY5000_Series dil 5j ke manifest v Files of type Component Files dll tIb olb ocx exe manifest v Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 2 Add Required GUI Components to the Application s Main Form 1 ou PF wh After all EE Form1 Add a PictureBox to the form and rename it to picPartImage Set the SizeMode to Stretchlmage and place in the top left of the form Add a ListBox to the form and rename it IstMeasurementData Place in the top right of the form Add a Button to the form and rename it to btnStart Set the Text Property to Start Add another button to the form and rename it to btnStop Set the Text Property to Stop Add Timer control to the form and rename it
14. em using System Collections Generic using System ComponentModel using System Data using System Drawing using System Text using System Windows Forms using CV5000_Series namespace CV5000_CSharp_Sample_Project public partial class Forml Form CV5000 cv5000 Delegate defines function used to update GUI in a threadsafe manner delegate void UpdateStringDelegate string entry public Forml InitializeComponent private void Forml_Load object sender EventArgs e Create an instance of the CV 5000 library cv5000 new CV5000 Set up the CV 5000 I P address and port information cv5000 RemotePort 8500 cv5000 RemoteImagePort 8501 cv5000 RemoteHost 192 168 168 211 cv5000 ConnectionEstablished new CV5000 ConnectionEstablishedHandler cv5000_ConnectionEstablished cv5000 ImageConnectionEstablished new CV5000 ImageConnectionEstablishedHandler cv5000_ImageConnectionEstablished cev5000 ErrorOccurred new CV5000 ErrorOccurredHandler cv5000_ErrorOccurred Connect to the CV 5000 series device cv5000 Connect Called with an invoke when udating txtStatus in event handler private void UpdateStatus string entry txtStatus Text entry r n txtStatus Text Update status TextBox using invoke private void SetStatus string entry Invoke new UpdateStringDelegate UpdateStatus entry void cv5000_ConnectionEstablished Triggered when the command port
15. he restrictions Conquest Consulting LLC in the End User License Agreement of this document 1 5 3 Running the Complete Sample Program Date November 18 2009 Run the program and the program should display both the measurement data and an image with each trigger You may want to pass your hand in front of the camera to be sure that the image is changing Again the image will be triggered once every 5 seconds so you may want to wait a few seconds ES Form1 71 0120099 1 09 06 05 19 45 06 71 0120070 1 09 06 05 19 45 11 71 035574 7 1 09 06 05 19 45 16 71 0120093 1 09 06 05 19 45 21 71 01 20002 1 09 06 05 19 45 26 71 0357115 1 09 06 05 19 45 31 71 01 20001 1 09 06 05 19 45 36 71 0357050 1 09 06 05 19 45 41 71 0119820 1 09 06 05 19 45 46 71 0119767 1 09 06 05 19 45 51 71 0119979 1 09 06 05 19 45 56 71 0120095 1 09 06 05 19 46 01 71 0120011 1 09 06 05 13 46 06 71 0120047 1 09 06 05 19 46 11 71 0120034 1 09 06 05 19 46 16 71 0120028 1 09 06 05 19 46 21 Image port connected Command port connected If you ran into an error while creating the code in this section Appendix A 3 contains a listing of the complete code CONGRATULATIONS You have just completed your first program 16 Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date November 18 2009 2 CONNECTION CODE LISTING using Syst
16. he restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 4 Retrieving Measurement Data from the CV 5000 Device In this section we will be expanding the code that we created in section 5 4 to retrieve measurement data from the CV 5000 and display it in the measurement list box We will introduce a new event DataReceived and set up the Start and Stop buttons 1 4 1 Updating the Measurement ListBox in a ThreadSafe way The sample application has a measurement listbox that is updated each time measurement data is received The code below shows how to use the CV 5000 NET Library in a thread safe way to update the measurement listbox in the application Add the following methods to the form class Add data received to measurement list box private void UpdateMeasurementData string entry lstMeasurementData Items Add entry Update Measurement list box use invoke if necessary private void SetMeasurementData string entry nvoke new UpdateStringDelegate UpdateMeasurementData entry The SetMeasurementData method invokes UpdateMeasurementData method because the SetMeasurementData method will be used in an event triggered from a separate thread NOTE The UpdateStringDelegate method is the same method that was created in section 5 4 4 so it is not recreated here You will notice that the UpdateMeasurementData method has a compatible signature which is why we can use t
17. he same delegate NOTE See the following article in Microsoft s documentation for more information on this concept http msdn microsoft com en us library system windows forms control invokerequired aspx 10 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 1 4 2 Add Data Received Event Handler Date November 18 2009 When the CV 5000 NET Library receives data from the CV 5000 it raises the Data Received event To retrieve the data you must hook into the event and add a handler for it First hook into the event in the form s load method with the rest of the handlers as shown below cv5000 ConnectionEs cv5000_Connect cv5000 ImageConne cv5000_ImageC tablished ablis new CV5000 ConnectionEstablishedHandler 1ed shed new CV5000 ImageConnectionEstablishedHandler ctionEstablished cev5000 ErrorOccurred new CV5000 ErrorOccurredHandler cv5000_ErrorOccurred cv5000 DataReceived new CV5000 DataReceivedHandler cv5000_DataReceived Connect to the CV 5000 series cv5000 Connect device Now that the hooks are in place we can add the event handler to our application Add the following method to the form class void cv5000_DataReceived DataEventArgs args string str The data from the CV 5000 is stored in if args ASCIIData Length gt 30 str args ASCIIData Substring 0 else
18. ication and press the start button The output should look similar to the following screen shot on the right The actual data shown will depend on the configuration of the program in the CV 5000 series device The data will be received once every 5 seconds so you may want to wait for about 20 seconds or so to elapse ES Form1 71 0082269 1 09 06 05 19 33 01 71 0078789 1 09 06 05 19 33 06 T1 0074613 1 09 06 05 19 33 11 T1 0073044 1 03 06 05 19 33 16 71 0073158 1 09 06 05 19 33 21 71 0075835 1 09 06 05 19 33 26 71 00761 20 1 09 06 05 19 33 31 71 0076936 1 09 06 05 19 33 36 71 0083165 1 09 06 05 19 33 41 Image port connected Start Command port connected If you ran into an error while creating the code in this section Section 3 contains a listing of the code up to this point 243 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 5 Retrieving Image Data from the CV 5000Device In this section we will be expanding the code that we created in section 5 5 to retrieve image data from the CV 5000 and display it in the picture box 1 5 1 Updating the PictureBox in a Thread safe Manner The sample application has a picture box that is updated each time image data is received The code below shows how to use the CV 5000 NET Library in a thread safe way to update the picture box in the application Add
19. id SetStatus string entry Invoke new UpdateStringDelegate UpdateStatus entry void cv5000_DataReceived DataEventArgs args string str The data from the CV 5000 is stored in args if args ASCIIData Length gt 30 str args ASCIIData Substring 0 30 else 21 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document str args ASCIIData if args RecMode CVRecMode CVError SetMeasurementData str else if args Port CVPort CVDataPort SetMeasurementData str j Date if args RecMode CVRecMode TrigImageData args RecMode CVRecMode RegImageBMP args RecMode CVRecMode ScreenCapture setBitmap args Bitmap Add data received to measurement list box private void UpdateMeasurementData string entry lstMeasurementData Items Add entry Update Measurement list box use invoke if necessary private void SetMeasurementData string entry Invoke new UpdateStringDelegate UpdateMeasurementData entry Add image to picturebox private void UpdateBitmap Bitmap bmp Bitmap oldBitmap oldBitmap Bitmap picPartImage Image if oldBitmap null Release windows resources oldBitmap Dispose picPartImage Image bmp Update picturebox using invoke private void setBitmap Bitmap bmp Invoke new UpdateBitmapDelegate UpdateBitmap bmp void cv5000_
20. is connected to SetStatus Command port connected void cv5000_ImageConnectionEstablished 17 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 Triggered when the image port is connected to SetStatus Image port connected void cv5000_ErrorOccurred ErrorOccurredEventArgs args if args ExceptionCaught null MessageBox Show args ErrorMessage args ExceptionCaught ToString j else MessageBox Show args ErrorMessage private void Forml_FormClosing object sender FormClosingEventArgs e cv5000 CloseConnection 18 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document 3 MEASUREMENT DATA CODE LISTING using System using System Collections Generic using System ComponentModel using System Data using System Drawing using System Text using System Windows Forms using CV5000_Series namespace CV5000_CSharp_Sample_Project public partial class Forml Form CV5000 cv5000 Date November 18 2009 Delegate defines function used to update GUI in a threadsafe manner delegate void UpdateStringDelegate string entry public Forml InitializeComponent private void Forml_Load object sender EventArgs e Create an i
21. nstance of the CV 5000 library cv5000 new CV5000 Set up the CV 5000 I P address and port information cv5000 RemotePort 8500 cv5000 RemoteImagePort 8501 cv5000 RemoteHost 192 168 168 211 cv5000 ConnectionEstablished new CV5000 ConnectionEstablishedHandler cv5000_ConnectionEstablished cv5000 ImageConnectionEstablished new CV5000 ImageConnectionEstablishedHandler cv5000_ImageConnectionEstablished cv5000 ErrorOccurred new CV5000 ErrorOccurredHandler cv5000_ErrorOccurred cv5000 DataReceived new CV5000 DataReceivedHandler cv5000_DataReceived Connect to the CV 5000 series device cv5000 Connect private void UpdateStatus string entry txtStatus Text entry r n txtStatus Text Update status TextBox using invoke private void SetStatus string entry void cv5000_DataReceived DataEventArgs args string str The data from the CV 5000 is stored in args if args ASCIIData Length gt 30 str args ASCIIData Substring 0 30 else str args ASCIIData 19 Called with an invoke when udating txtStatus in event handler Invoke new UpdateStringDelegate UpdateStatus entry Use or disclosure of data on this page is subject to the restrictions in the End User License Agreement of this document Conquest Consulting LLC Date November 18 2009 if args RecMode CVRecMode CVError SetMeasurementData str else if args Por
22. o the library as defined in Section 5 2 Now double click on the title of the form to bring up the forms code window and add the following above the forms class definition as shown using CV5000_Series public partial class Forml Form public Forml InitializeComponent i For this sample program we are going to create a CV 5000 object that is global to Form1 Add the following code just below the forms class definition as shown below using CV5000_Series espace CV5000_CSharp_Sample_Project public partial class Forml Form CV5000 cv5000 public Forml InitializeComponent Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 1 3 2 Connecting to the CV The sample program will connect to the CV 5000 as soon as it starts up so we will need to create an instance of the CV 5000 library enter the password and configure it to connect to the CV 5000 when the form loads This is accomplished by adding the following code to the form s load event as shown below private void Forml_Load object sender EventArgs e Create an instance of the CV 5000 library cv5000 new CV5000 Set up the CV 5000 I P address and port information cv5000 RemotePort 8500 cv5000 RemoteImagePort 8501 cv5000 RemoteHost 192 168 168 211 Connect to the CV 5000 series device cv5000 Conne
23. solution Solution Name Once you click on OK you should C S000_CSharp_Sample_Project Add to Source Control Bia have a blank project open that looks similar to the screen below If the solution explorer is not open see right hand side of image below you will need to open it by clicking View Solution Explorer on the Visual Studio menu CV5000_CSharp_Sample_Project Microsoft Visual Studio File Edit View Project Buld Debug Data Format Tools Test Window Help 4 gt Debug gt Any CPU BY dataevent JAF ER Bos Hex ot dabas Brz Ti ot a 4 3 i rA X Formi cs Design Start Page _ MaskedTextBox E MonthCalendar Tal NotifyIcon 3 NumericUpDown tal PictureBox E ProgressBar RadioButton 85 RichTextBox bi TextBox Ra ToolTip Te Treeview EJ WebBrowser Output Show output from FlowLayoutPanel GroupBox Panel SplitContainer Serve eraa f Sq Server Explorer 32 Toolbox x Solution Explorer Solution CV5000_CSharp_Sample_Project 1 project JEA A Solution C S000_CSharp_Sample_Project 1 project F cvs000_csharp_Sample_Project Ea Properties E E References a E Formi cs qE Program cs J Solution Explorer aglas View Properties Form1 System Windows Forms Form ez 24 ea E MinimumSize E Padding Size StartPosition WindowState B Misc
24. t CVPort CVDataPort SetMeasurementData str Add data received to measurement list box private void UpdateMeasurementData string entry lstMeasurementData Items Add entry Update Measurement list box use invoke if necessary private void SetMeasurementData string entry Invoke new UpdateStringDelegate UpdateMeasurementData entry void cv5000_ConnectionEstablished Triggered when the command port is connected to SetStatus Command port connected void cv5000_ImageConnectionEstablished Triggered when the image port is connected to SetStatus Image port connected void cv5000_ErrorOccurred ErrorOccurredEventArgs args if args ExceptionCaught null MessageBox Show args ErrorMessage args ExceptionCaught ToString j else MessageBox Show args ErrorMessage private void Forml_FormClosing object sender FormClosingEventArgs e cv5000 CloseConnection private void tmrTrigger_Tick object sender EventArgs e cv5000 Trigger 1 private void btnStart_Click object sender EventArgs e Trigger the CV 5000 device now cv5000 Trigger 1 tmrTrigger Interval 5000 tmrTrigger Enabled true private void btnStop_Click object sender EventArgs e tmrTrigger Enabled false 20 Use or disclosure of data on this page is subject to the restrictions Conquest Consulting LLC in the End User License Agreement of this document Date November 18 2009 4 CO
Download Pdf Manuals
Related Search
here hereditary heretic heredity here movie heretic definition hereinafter heresy definition hereditary meaning here comes the sun here\u0027s johnny hereby here comes the guide hereditary hemochromatosis hereditary angioedema here i am to worship lyrics here comes the sun lyrics heretic movie hereditary spherocytosis herencia hereditary movie here to slay hereditary hemorrhagic telangiectasia heredia costa rica here come the mummies here comes the bus
Related Contents
View the User Manual Manual - FRA - AL66 Batavia 7061488 power sander Syringe Dispenser Spritzendosierer - Henkel vous informe - Cabanac et Villagrains PS300B - Hoefer Inc Relatório de Caracterização e Diagnóstico 1 Program Summary Philips Saeco HD8942 Computer Tech Link 7dln User's Manual Copyright © All rights reserved.
Failed to retrieve file