RobotStudio event

Byte to bit conversion in RobotStudio

Hello,<br><br>I am using OPC smart component in RobotStudio to receive digital signals from an OPC server. This works fine although the number of signals that can be used in the OPC smart component seems to be limited. Now, my idea is not to transmit single bits but bytes. Therefore I need to do a byte to bit conversion in RobotStudio so that I can use the single bits in my program.<br>Does anyone know how I can do this? Maybe by using group inputs?<br><br><br>Thank you<br>Kind regards,<br><br>Jonas

Comments

  • <div><font face="Arial, Verdana"><span style="font-size: 10pt; line-height: normal;">I don't know anything about OPC SC but:</span></font></div><font face="Arial, Verdana"><span style="font-size: 10pt; line-height: normal;">You can use BitCheck(data,bit) if you want to check a bit in a num value. </span></font><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"><br></div><div style="font-family: Arial, Verdana; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;">something like:</div><div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">PROC testGroupe()</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">    CONST num bitNo:=3;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">    VAR num tmp;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">    VAR bool bBitCheck;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">    </span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">    tmp:=giTestGroupe;</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">    bBitCheck:=BitCheck(tmp,bitNo);</span></font></div><div><font face="Arial, Verdana"><span style="font-size: 13.3333330154419px; line-height: normal;">endproc</span></font></div></div>
  • Ehm is it only my view that is filled with <Html> code?
  • svoldgaard wrote: »
    Ehm is it only my view that is filled with <Html> code?

    <br><br>No, it's been happening all over the forum for a quite a while....<br>
  • Thank you for your answer!<br>I can see the html code as well...<br>I've hoped that there is a smart component for getting single bits of a byte but I will try your solution.<br><br>Best regards,<br>Jonas<br>