UserControl9.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using YG.Device;
  11. namespace IMCS.UControl
  12. {
  13. public partial class UserControl9 : UserControl
  14. {
  15. enum itemoperation
  16. {
  17. 取=1,
  18. 取执行中, 取完成, 放, 放执行中, 放完成, 移动, 移动完成, 机器人故障
  19. }
  20. public UserControl9()
  21. {
  22. InitializeComponent();
  23. this.Load += UserControl9_Load;
  24. }
  25. private void UserControl9_Load(object sender, EventArgs e)
  26. {
  27. weiLi.DeviceInit();
  28. }
  29. DeviceS7 weiLi = new DeviceS7(HslCommunication.Profinet.Siemens.SiemensPLCS.S1500, "192.168.0.10");
  30. private void button1_Click(object sender, EventArgs e)
  31. {
  32. weiLi.DeviceSend("DB200.44", textBox1.Text.ObjectToShort());
  33. weiLi.DeviceSend("DB200.46", textBox1.Text.ObjectToShort());
  34. weiLi.DeviceSend("DB200.48", textBox1.Text.ObjectToShort());
  35. weiLi.DeviceSend("DB200.50", ((int)itemoperation.移动).ObjectToShort());
  36. }
  37. }
  38. }