// Get the substitution rule data private void SubGet_Click(object sender, EventArgs e) { byte[] data; if (vCat >= 0) { if (EIP.StartSession()) { // Save the state on entry if (EIP.ForwardOpen()) { for (int i = 0; i < subLabels[vCat].Length; i++) { // Get the substitution all at once data = EIP.ToBytes((i + startWith[vCat]), 1); EIP.SetDataValue = data[0].ToString(); if (EIP.GetAttribute(ClassCode.Substitution_rules, (byte)at[vCat], data)) { subTexts[vCat][i].Text = EIP.GetDataValue; } } } EIP.ForwardClose(); } EIP.EndSession(); } SetButtonEnables(); }
private void cmdGetGroupNames_Click(object sender, EventArgs e) { lbGroupNames.Items.Clear(); if (EIP.StartSession()) { if (EIP.ForwardOpen()) { for (int i = 0; i < 100; i += 10) { byte[] GroupNames; bool success = EIP.GetAttribute(ccPDM.List_of_Groups, i, out GroupNames); if (success) { for (int j = 0; j < GroupNames.Length; j += 50) { long n = EIP.Get(GroupNames, j, 2, mem.LittleEndian); string Name = EIP.GetUTF8(GroupNames, j + 2, 48).Replace("\0", ""); if (Name.Length > 2) { lbGroupNames.Items.Add($"{n:00} | {Name}"); } } } } } EIP.ForwardClose(); } EIP.EndSession(); }
private void CmdGetErrors_Click(object sender, EventArgs e) { if (EIP.StartSession()) { if (EIP.ForwardOpen()) { EIP.GetAttribute(ClassCode.IJP_operation, (byte)ccIJP.Fault_and_warning_history, EIP.Nodata); byte[] d = EIP.GetData; lbErrors.Items.Clear(); long count = 0; if (d.Length > 3) { count = EIP.Get(d, 0, 4, mem.LittleEndian); for (int i = 0; i < Math.Min(count, (d.Length - 4) / 10); i++) { int n = i * 10 + 4; long year = EIP.Get(d, n, 2, mem.LittleEndian); lbErrors.Items.Add($"{i + 1:00} | {year:0000}/{d[n + 2]:00}/{d[n + 3]:00} {d[n + 4]:00}:{d[n + 5]:00}:{d[n + 6]:00} | {d[n + 7]:00} | {d[n + 8]:00} | {d[n + 9]:00}"); } } txtErrorCount.Text = count.ToString(); } EIP.ForwardClose(); } EIP.EndSession(); }
// Start a new session private void btnStartSession_Click(object sender, EventArgs e) { // Verify the IP address and port. Then use them to open the session VerifyAddressAndPort(); EIP.IPAddress = txtIPAddress.Text; EIP.port = port; // Be sure that com is on if (EIP.StartSession()) { // Session ID is returned txtSessionID.Text = EIP.SessionID.ToString(); // Open a path to the device if (EIP.ForwardOpen()) { // Blindly Set COM on and read it back if (EIP.SetAttribute(ccIJP.Online_Offline, "On Line")) { GetComSetting(); if (ComIsOn) { // Got it, Get the other critical settings GetAutoReflectionSetting(); GetMgmtSetting(); } } // Close the forward to avoid a timeout } EIP.ForwardClose(); } SetButtonEnables(); }
private bool MultiLine() { bool success = true; if (EIP.StartSession(true)) // Open a session { if (EIP.ForwardOpen()) // open a data forwarding path { try { // Be sure we are in Individual Layout EIP.SetAttribute(ccPF.Format_Setup, "Individual"); // Clean up the display EIP.DeleteAllButOne(); // Select item 1 and set to 1 line (1 origin on Line Count) EIP.SetAttribute(ccIDX.Item, 1); EIP.SetAttribute(ccPF.Line_Count, 1); // Add four more columns for (int i = 2; i <= 5; i++) { EIP.ServiceAttribute(ccPF.Add_Column, 0); } // Stack columns 2 and 4 (1 origin on Line Count) EIP.SetAttribute(ccIDX.Item, 2); EIP.SetAttribute(ccPF.Line_Count, 2); EIP.SetAttribute(ccIDX.Item, 4); EIP.SetAttribute(ccPF.Line_Count, 2); // Set the text in the items for (int i = 1; i <= 7; i++) { EIP.SetAttribute(ccIDX.Item, i); // Select item if (i == 1 || i == 4 || i == 7) // Set the font and text { EIP.SetAttribute(ccPF.Print_Character_String, $"{i}"); EIP.SetAttribute(ccPF.Dot_Matrix, "12x16"); } else { EIP.SetAttribute(ccPF.Print_Character_String, $" {i} "); EIP.SetAttribute(ccPF.Dot_Matrix, "5x8"); } } } catch (EIPIOException e1) { // In case of an EIP I/O error string name = $"{EIP.GetAttributeName(e1.ClassCode, e1.Attribute)}"; string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); success = false; } catch { // You are on your own here } } EIP.ForwardClose(); // Must be outside the ForwardOpen if block } EIP.EndSession(); // Must be outside the StartSession if block return(success); }
// Get all the valid input data on the display private void GetAll_Click(object sender, EventArgs e) { parent.AllGood = true; // Set all controls to their initial empty state for (int i = 0; i < gets.Length; i++) { counts[i].BackColor = SystemColors.Control; if (gets[i] != null) { if (dropdowns[i] != null) { dropdowns[i].Visible = false; texts[i].Visible = true; } texts[i].Text = "Loading"; texts[i].BackColor = SystemColors.Control; } } // Avoid Open/Close on each request if (EIP.StartSession()) { if (EIP.ForwardOpen()) { // Do them all but stop on an error for (int i = 0; i < gets.Length && parent.AllGood; i++) { if (gets[i] != null) { Get_Click(gets[i], null); // Let the Cancel button event be processed Application.DoEvents(); } } if (!parent.AllGood) { // Oops, something bad happened parent.EIP_Log(null, "GetAll completed abnormally"); } } EIP.ForwardClose(); } EIP.EndSession(); SetButtonEnables(); }
// Send characters to the printer private void UpSet_Click(object sender, EventArgs e) { if (EIP.StartSession()) { if (EIP.ForwardOpen()) { byte[][] b = StripesToBytes(charHeight, BitMapToStripes(bmGrid, charWidth)); byte[] data; for (int i = 0; i < Count; i++) { if ((Layout)cbLayout.SelectedIndex == Layout.Fixed) { AttrData attr = EIP.GetAttrData(ccUP.User_Pattern_Fixed); // Font ID, Position, and Bit Map data = EIP.FormatOutput(attr.Set, new int[] { dotMatrixCode, Registration + i }, b[i]); if (!EIP.SetAttribute(ClassCode.User_pattern, (byte)ccUP.User_Pattern_Fixed, data)) { EIP.LogIt("Fixed Pattern Download Failed. Aborting Download!"); break; } } else { AttrData attr = EIP.GetAttrData(ccUP.User_Pattern_Free); // Vertical Size (charHeigth), Horizontol Size (charWidth), Position, Bit Map data = EIP.FormatOutput(attr.Set, new int[] { charHeight, charWidth, Registration + i }, b[i]); if (!EIP.SetAttribute(ClassCode.User_pattern, (byte)ccUP.User_Pattern_Free, data)) { EIP.LogIt("Free Pattern Download Failed. Aborting Download!"); break; } } } } EIP.ForwardClose(); } EIP.EndSession(); SetButtonEnables(); }
public bool CleanUpDisplay() { bool success = true; if (EIP.StartSession(true)) { if (EIP.ForwardOpen()) { try { // Get the number of columns EIP.GetAttribute(ccPF.Number_Of_Columns, out int cols); // No need to delete columns if there is only one if (cols > 1) { // Select to continuously delete column 2 (0 origin on deletes) EIP.SetAttribute(ccIDX.Column, 1); // Column number is 0 origin while (--cols > 0) { // Delete the column EIP.ServiceAttribute(ccPF.Delete_Column); } } // Select item 1 (1 origin on Line Count) EIP.SetAttribute(ccIDX.Item, 1); // Set line count to 1. (Need to find out how delete single item works.) EIP.SetAttribute(ccPF.Line_Count, 1); // Test item size EIP.SetAttribute(ccPF.Dot_Matrix, "5x8"); EIP.SetAttribute(ccPF.Barcode_Type, "None"); // Set simple text in case Calendar or Counter was used EIP.SetAttribute(ccPF.Print_Character_String, "1"); } catch (EIPIOException e1) { // In case of an EIP I/O error string name = $"{EIP.GetAttributeName(e1.ClassCode, e1.Attribute)}"; string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); success = false; } catch { // You are on your own here } } EIP.ForwardClose(); } EIP.EndSession(); return(success); }
public bool SetText(string text) { bool success = true; string[] s = text.Split('\n'); if (EIP.StartSession(true)) { if (EIP.ForwardOpen()) { try { // Clean up the display EIP.DeleteAllButOne(); // Select the item EIP.SetAttribute(ccIDX.Item, 1); // Insert the text EIP.SetAttribute(ccPF.Print_Character_String, s[0]); for (int i = 1; i < s.Length; i++) { EIP.ServiceAttribute(ccPF.Add_Column); EIP.SetAttribute(ccIDX.Item, i + 1); EIP.SetAttribute(ccPF.Print_Character_String, s[i]); } // Set info in first Calendar Block EIP.SetAttribute(ccIDX.Item, 1); EIP.GetAttribute(ccCal.First_Calendar_Block, out int calNo); EIP.SetAttribute(ccIDX.Calendar_Block, calNo); EIP.SetAttribute(ccCal.Offset_Month, 1); // Set info in Second Calendar Block EIP.SetAttribute(ccIDX.Item, 2); EIP.GetAttribute(ccCal.First_Calendar_Block, out calNo); EIP.SetAttribute(ccIDX.Calendar_Block, calNo); EIP.SetAttribute(ccCal.Zero_Suppress_Hour, "Space Fill"); } catch (EIPIOException e1) { // In case of an EIP I/O error string name = $"{EIP.GetAttributeName(e1.ClassCode, e1.Attribute)}"; string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); success = false; } catch { // You are on your own here } } EIP.ForwardClose(); } EIP.EndSession(); return(success); }
// Create a message with text only (Control Deleted) private void cmdCreateText_Click(object sender, EventArgs e) { if (EIP.StartSession()) { if (EIP.ForwardOpen()) { try { for (int step = 0; step < 3; step++) { switch (step) { case 0: // Cleanup the display CleanUpDisplay(); break; case 1: // Put in some items for (int i = 0; i < 5; i++) { EIP.ServiceAttribute(ccPF.Add_Column, 0); } break; case 2: // Set the text SetText("Hello World"); break; } } } catch (EIPIOException e1) { // In case of an EIP I/O error string name = $"{EIP.GetAttributeName(e1.ClassCode, e1.Attribute)}"; string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); } catch { // You are on your own here } } EIP.ForwardClose(); } EIP.EndSession(); }
// Same as above but recoded for performance private bool ComprehensiveII() { bool success = true; string[] itemText = new string[] { "SELLBY {{MMM}/{DD}/{YY}} ", "USE BY {{MMM}/{DD}/{YY}} ", "PACKED {{TTT} {777}} ", "Shift {{E}}", "T-Ct {{FF}} ", "#{{CCCCCC}} ", "{X/0}" }; if (EIP.StartSession(true)) { if (EIP.ForwardOpen()) { EIP.UseAutomaticReflection = true; // Make things as fast as possible try { // Load the message type { EIP.SetAttribute(ccPF.Format_Setup, "Individual"); // Clean up the display EIP.DeleteAllButOne(); } // Clean up the display { EIP.GetAttribute(ccPF.Number_Of_Columns, out int cols); if (cols > 1) { EIP.SetAttribute(ccIDX.Column, 1); // Actually column 2 while (--cols > 0) { EIP.ServiceAttribute(ccPF.Delete_Column); } } EIP.SetAttribute(ccIDX.Item, 1); EIP.SetAttribute(ccPF.Line_Count, 1); // Avoid issues with add columns EIP.SetAttribute(ccPF.Dot_Matrix, "5x8"); EIP.SetAttribute(ccPF.Barcode_Type, "None"); EIP.SetAttribute(ccPF.Print_Character_String, "1"); } // Set up the rows and columns { // First column is already there, just create the second and third columns EIP.ServiceAttribute(ccPF.Add_Column); EIP.ServiceAttribute(ccPF.Add_Column); // Allocate the items in each column (Should this be Column and not Item?) EIP.SetAttribute(ccIDX.Item, 1); EIP.SetAttribute(ccPF.Line_Count, 3); EIP.SetAttribute(ccIDX.Item, 2); EIP.SetAttribute(ccPF.Line_Count, 3); EIP.SetAttribute(ccIDX.Item, 3); EIP.SetAttribute(ccPF.Line_Count, 1); // Set the Interline Spacing EIP.SetAttribute(ccIDX.Column, 1); EIP.SetAttribute(ccPF.Line_Spacing, 1); EIP.SetAttribute(ccIDX.Column, 2); EIP.SetAttribute(ccPF.Line_Spacing, 2); } // Format the items { // Set the format consistant for all six items for (int i = 1; i <= 6; i++) { EIP.SetAttribute(ccIDX.Item, i); EIP.SetAttribute(ccPF.Dot_Matrix, "5x8"); EIP.SetAttribute(ccPF.InterCharacter_Space, 1); EIP.SetAttribute(ccPF.Character_Bold, 1); EIP.SetAttribute(ccPF.Barcode_Type, "None"); EIP.SetAttribute(ccPF.Print_Character_String, itemText[i - 1]); } // Set a logo into the seventh item EIP.SetAttribute(ccIDX.Item, 7); EIP.SetAttribute(ccPF.Dot_Matrix, "18x24"); EIP.SetAttribute(ccPF.InterCharacter_Space, 2); EIP.SetAttribute(ccPF.Character_Bold, 2); EIP.SetAttribute(ccPF.Barcode_Type, "None"); EIP.SetAttribute(ccPF.Print_Character_String, itemText[6]); } // Now gather all the information needed to set up the Calendar and Counter blocks EIP.UseAutomaticReflection = false; // Make things as fast as possible EIP.SetAttribute(ccIDX.Item, 1); EIP.GetAttribute(ccCal.First_Calendar_Block, out int firstBlock1); EIP.SetAttribute(ccIDX.Item, 2); EIP.GetAttribute(ccCal.First_Calendar_Block, out int firstBlock2); EIP.SetAttribute(ccIDX.Item, 3); EIP.GetAttribute(ccCal.First_Calendar_Block, out int firstBlock3); EIP.SetAttribute(ccIDX.Item, 4); EIP.GetAttribute(ccCal.First_Calendar_Block, out int firstBlock4); EIP.SetAttribute(ccIDX.Item, 5); EIP.GetAttribute(ccCal.First_Calendar_Block, out int firstBlock5); EIP.SetAttribute(ccIDX.Item, 6); EIP.GetAttribute(ccCount.First_Count_Block, out int firstBlock6); EIP.UseAutomaticReflection = true; // Make things as fast as possible // Set up the clock for item 1 { EIP.SetAttribute(ccIDX.Item, 1); EIP.SetAttribute(ccIDX.Calendar_Block, firstBlock1); EIP.SetAttribute(ccCal.Substitute_Month, "Enable"); EIP.SetAttribute(ccCal.Zero_Suppress_Day, "Space Fill"); } // Set up the clock for item 2 { EIP.SetAttribute(ccIDX.Item, 2); EIP.SetAttribute(ccIDX.Calendar_Block, firstBlock2); EIP.SetAttribute(ccCal.Substitute_Month, "Enable"); EIP.SetAttribute(ccCal.Zero_Suppress_Day, "Space Fill"); EIP.SetAttribute(ccCal.Offset_Day, 30); EIP.SetAttribute(ccPF.Calendar_Offset, "From Yesterday"); } // Set up the clock for item 3 { EIP.SetAttribute(ccIDX.Item, 3); EIP.SetAttribute(ccIDX.Calendar_Block, firstBlock3); EIP.SetAttribute(ccCal.Substitute_DayOfWeek, "Enable"); } // Set up the clock for item 4 { EIP.SetAttribute(ccIDX.Item, 4); EIP.SetAttribute(ccIDX.Calendar_Block, firstBlock4); // Set < Shift Number="1" StartHour="00" StartMinute="00" EndHour="7" EndMinute="59" Text="D" /> EIP.SetAttribute(ccIDX.Calendar_Block, 1); EIP.SetAttribute(ccCal.Shift_Start_Hour, 0); EIP.SetAttribute(ccCal.Shift_Start_Minute, 0); EIP.SetAttribute(ccCal.Shift_String_Value, "D"); // Set < Shift Number="2" StartHour="8" StartMinute="00" EndHour="15" EndMinute="59" Text="E" /> EIP.SetAttribute(ccIDX.Calendar_Block, 2); EIP.SetAttribute(ccCal.Shift_Start_Hour, 8); EIP.SetAttribute(ccCal.Shift_Start_Minute, 0); EIP.SetAttribute(ccCal.Shift_String_Value, "E"); // Set < Shift Number="2" StartHour="16" StartMinute="00" EndHour="23" EndMinute="59" Text="F" /> EIP.SetAttribute(ccIDX.Calendar_Block, 3); EIP.SetAttribute(ccCal.Shift_Start_Hour, 16); EIP.SetAttribute(ccCal.Shift_Start_Minute, 0); EIP.SetAttribute(ccCal.Shift_String_Value, "F"); } // Set up the clock for item 5 { EIP.SetAttribute(ccIDX.Item, 5); EIP.SetAttribute(ccIDX.Calendar_Block, firstBlock5); // Set <TimeCount Start="A1" End="X2" Reset="A1" ResetTime="6" RenewalPeriod="30 Minutes" /> EIP.SetAttribute(ccCal.Update_Interval_Value, "30 Minutes"); EIP.SetAttribute(ccCal.Time_Count_Start_Value, "A1"); EIP.SetAttribute(ccCal.Time_Count_End_Value, "X2"); EIP.SetAttribute(ccCal.Reset_Time_Value, 6); EIP.SetAttribute(ccCal.Time_Count_Reset_Value, "A1"); } // Set up the counter for item 6 { EIP.SetAttribute(ccIDX.Item, 6); EIP.SetAttribute(ccIDX.Count_Block, firstBlock6); EIP.SetAttribute(ccCount.Initial_Value, "000001"); EIP.SetAttribute(ccCount.Count_Range_1, "000000"); EIP.SetAttribute(ccCount.Count_Range_2, "999999"); EIP.SetAttribute(ccCount.Jump_From, "000199"); EIP.SetAttribute(ccCount.Jump_To, "000300"); EIP.SetAttribute(ccCount.Increment_Value, 2); EIP.SetAttribute(ccCount.Direction_Value, "Down"); EIP.SetAttribute(ccCount.Zero_Suppression, "Enable"); EIP.SetAttribute(ccCount.Count_Multiplier, "2"); EIP.SetAttribute(ccCount.Reset_Value, "000001"); EIP.SetAttribute(ccCount.Count_Skip, "0"); EIP.SetAttribute(ccCount.Update_Unit_Halfway, 0); EIP.SetAttribute(ccCount.Update_Unit_Unit, 1); EIP.SetAttribute(ccCount.Type_Of_Reset_Signal, "Signal 1"); EIP.SetAttribute(ccCount.External_Count, "Disable"); } // Set up the logo for item 7 { // Once logo processing works in the printer, loading of the logo will be added here. } // Load the message properties { EIP.SetAttribute(ccPS.Character_Orientation, "Inverted/Forward"); EIP.SetAttribute(ccPS.Target_Sensor_Filter, "Until End of Print"); EIP.SetAttribute(ccPS.Target_Sensor_Filter_Value, 50); EIP.SetAttribute(ccPS.Target_Sensor_Timer, 0); EIP.SetAttribute(ccPS.Character_Height, 99); EIP.SetAttribute(ccPS.Character_Width, 10); EIP.SetAttribute(ccPS.Print_Start_Delay_Forward, 96); EIP.SetAttribute(ccPS.Print_Start_Delay_Reverse, 96); EIP.SetAttribute(ccPS.Ink_Drop_Use, 2); EIP.SetAttribute(ccPS.Ink_Drop_Charge_Rule, "Mixed"); EIP.SetAttribute(ccPS.Product_Speed_Matching, "None"); } } catch (EIPIOException e1) { // In case of an EIP I/O error string name = EIP.GetAttributeName(e1.ClassCode, e1.Attribute); string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); success = false; } catch { // You are on your own here } finally { EIP.UseAutomaticReflection = false; // Make things as fast as possible } } EIP.ForwardClose(); } EIP.EndSession(); return(success); }
private bool CreateCounter() { bool success = true; if (EIP.StartSession(true)) { if (EIP.ForwardOpen()) { try { // Clean up the display EIP.DeleteAllButOne(); // Select item #1 EIP.SetAttribute(ccIDX.Item, 1); // Set Text as a 4 digit counter EIP.SetAttribute(ccPF.Print_Character_String, "{{CCCC}} {{CCC}}"); // Now retrieve the counter block allocations EIP.GetAttribute(ccCount.First_Count_Block, out int firstBlock); EIP.GetAttribute(ccCount.Number_Of_Count_Blocks, out int blockCount); // Set <Counter InitialValue="0001" Range1="0000" Range2="9999" JumpFrom="6666" JumpTo ="7777" // Increment="1" Direction="Up" ZeroSuppression="Enable" UpdateIP="0" UpdateUnit="1" // Multiplier ="2" CountSkip="0" Reset="0001" ExternalSignal="Disable" ResetSignal="Signal 1" /> // Set item number in count block EIP.SetAttribute(ccIDX.Count_Block, firstBlock); EIP.SetAttribute(ccCount.Initial_Value, "0001"); EIP.SetAttribute(ccCount.Count_Range_1, "0000"); EIP.SetAttribute(ccCount.Count_Range_2, "9999"); EIP.SetAttribute(ccCount.Jump_From, "6666"); EIP.SetAttribute(ccCount.Jump_To, "7777"); EIP.SetAttribute(ccCount.Increment_Value, 1); EIP.SetAttribute(ccCount.Direction_Value, "Up"); EIP.SetAttribute(ccCount.Zero_Suppression, "Disable"); EIP.SetAttribute(ccCount.Count_Multiplier, "2"); EIP.SetAttribute(ccCount.Reset_Value, "0001"); EIP.SetAttribute(ccCount.Count_Skip, "0"); EIP.SetAttribute(ccCount.Update_Unit_Halfway, 0); // Causes COM Error EIP.SetAttribute(ccCount.Update_Unit_Unit, 1); // Causes COM Error EIP.SetAttribute(ccCount.Type_Of_Reset_Signal, "Signal 1"); // Causes COM Error EIP.SetAttribute(ccCount.External_Count, "Disable"); // Causes COM Error // In case it is the two counter test if (blockCount > 1) { EIP.SetAttribute(ccIDX.Count_Block, firstBlock + 1); EIP.SetAttribute(ccCount.Initial_Value, "001"); EIP.SetAttribute(ccCount.Count_Range_1, "000"); EIP.SetAttribute(ccCount.Count_Range_2, "999"); EIP.SetAttribute(ccCount.Jump_From, "199"); EIP.SetAttribute(ccCount.Jump_To, "300"); EIP.SetAttribute(ccCount.Increment_Value, 2); EIP.SetAttribute(ccCount.Direction_Value, "Down"); EIP.SetAttribute(ccCount.Zero_Suppression, "Disable"); EIP.SetAttribute(ccCount.Count_Multiplier, "2"); EIP.SetAttribute(ccCount.Reset_Value, "001"); EIP.SetAttribute(ccCount.Count_Skip, "0"); EIP.SetAttribute(ccCount.Update_Unit_Halfway, 0); // Causes COM Error EIP.SetAttribute(ccCount.Update_Unit_Unit, 1); // Causes COM Error EIP.SetAttribute(ccCount.Type_Of_Reset_Signal, "Signal 1"); // Causes COM Error EIP.SetAttribute(ccCount.External_Count, "Disable"); // Causes COM Error } } catch (EIPIOException e1) { // In case of an EIP I/O error string name = $"{EIP.GetAttributeName(e1.ClassCode, e1.Attribute)}"; string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); success = false; } catch { // You are on your own here } } EIP.ForwardClose(); } EIP.EndSession(); return(success); }
// Run hard coded test private void cmdRunHardTest_Click(object sender, EventArgs e) { if (EIP.StartSession(true)) { if (EIP.ForwardOpen()) { try { // Run selected test switch (cbAvailableHardTests.SelectedIndex) { case 0: // Clean up the display EIP.DeleteAllButOne(); // Gets us down to a single item break; case 1: BuildShifts(); break; case 2: BuildMonthDaySR(); break; case 3: BuildTimeCount(); break; case 4: TryDayOfWeekEtc(); break; case 5: BuildMDYhms(); break; case 6: MultiLine(); break; case 7: CreateCounter(); break; case 8: ComprehensiveI(); break; case 9: ComprehensiveII(); break; case 10: SetText("{{MMM}/{DD}/{YY}}\n {{hh}:{mm}:{ss}}"); break; } //VerifyShifts(Item++); } catch (EIPIOException e1) { // In case of an EIP I/O error string name = $"{EIP.GetAttributeName(e1.ClassCode, e1.Attribute)}"; string msg = $"EIP I/O Error on {e1.AccessCode}/{e1.ClassCode}/{name}"; MessageBox.Show(msg, "EIP I/O Error", MessageBoxButtons.OK); } catch { // You are on your own here } } EIP.ForwardClose(); } EIP.EndSession(); }