Package promauto.jroboplc.roboplant

Examples of promauto.jroboplc.roboplant.RoboplantChannel


    Tag t5 = m3.tagTable.createTag("Input10", 55);
    Tag t6 = m3.tagTable.createTag("Input11", 66);
    Tag t7 = m4.tagTable.createTag("Input20", 77);
    Tag t8 = m4.tagTable.createTag("Input21", 88);
   
    RoboplantChannel channel1 = new RoboplantChannel();
    channel1.createTags(m1, "mychannel");
   
    // link to t3
    channel1.tagChannel.set(0x0100);
    assertTrue( channel1.checkChannel(false) );
    assertTrue( channel1.changed );
    assertEquals( channel1.tagName.getString(), "mod2@Output00" );
    assertEquals( channel1.get(), t3.getInteger() );
   
    t3.set( 133 );
    assertEquals( channel1.get(), t3.getInteger() );
   
    channel1.set( 233 );
    assertEquals( channel1.get(), t3.getInteger() );

    assertTrue( channel1.checkChannel(false) );
    assertFalse( channel1.changed );
    assertEquals( channel1.tagName.getString(), "mod2@Output00" );
    assertEquals( channel1.get(), t3.getInteger() );
   
    // link to t5
    channel1.setName("mod3@Input10");
    assertTrue( channel1.checkChannel(true) );
    assertTrue( channel1.changed );
    assertEquals(channel1.tagChannel.getInteger(), new Integer(0x020A));
    assertEquals( channel1.tagName.getString(), "mod3@Input10" );
    assertEquals( channel1.get(), t5.getInteger() );
   
    assertTrue( channel1.checkChannel(true) );
    assertFalse( channel1.changed );
   
    // link to unknown
    channel1.setName("mod777@Input10");
    assertFalse( channel1.checkChannel(true) );
    assertTrue( channel1.changed );
    assertFalse( channel1.checkChannel(true) );
    assertFalse( channel1.changed );
    assertFalse( channel1.checkChannel(true) );
    assertFalse( channel1.changed );
   
    // link to t8 (none roboplant tag)
    channel1.setName("mod4@Input21");
    assertTrue( channel1.checkChannel(true) );
    assertTrue( channel1.changed );
    assertTrue( channel1.checkChannel(true) );
    assertFalse( channel1.changed );
    assertTrue( channel1.checkChannel(true) );
    assertFalse( channel1.changed );
   
    t8.set( 1884 );
    assertEquals( channel1.get(), t8.getInteger() );
   
    channel1.set( 2997 );
    assertEquals( channel1.get(), t8.getInteger() );
  }
View Full Code Here

TOP

Related Classes of promauto.jroboplc.roboplant.RoboplantChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.