07-17-2018 04:53 AM
Dear All,,
I'm trying connect PC to CTS Chamber through RS232 using serial communication. I need to control Temp using Labview the problem is refer to the PDF attach section E.2.3 i need to send a string to set the temp to -14.5 I build the VI but the string still not correct ,Can somebody told me how can I replace Element inside array. I'll attach the labview file to know what going on.I need replace ''AC'' to ''AE'' According to the PDF file attached.
the Check sum also it doesn't correct refer to the PDF File the CHK is C3 and in my labview program is C1.
Please your help is appreciated
Solved! Go to Solution.
07-17-2018 07:16 AM
Hi,
Below is the logic.
07-17-2018 09:35 AM - edited 07-17-2018 09:36 AM
Thank you
07-18-2018 03:01 PM - edited 07-18-2018 03:01 PM
@SAED123 wrote:
Dear All,,
I'm trying connect PC to CTS Chamber through RS232 using serial communication. I need to control Temp using Labview the problem is refer to the PDF attach section E.2.3 i need to send a string to set the temp to -14.5 I build the VI but the string still not correct ,Can somebody told me how can I replace Element inside array. I'll attach the labview file to know what going on.I need replace ''AC'' to ''AE'' According to the PDF file attached.
the Check sum also it doesn't correct refer to the PDF File the CHK is C3 and in my labview program is C1.
Please your help is appreciated
Is this due to the localization code of your decimal separator being a comma? You can change the default localization code by using %.; for period. Lots easier than using a Search 1d Array function afterwards. BTW, any method that you use to change the decimal separator has to be done before you generate the CHK. So jay0909's method of simply replacing the value would have a wrong CHK value.
Your CHK algorithm is wrong. You are using a "Not Exclusive Or". Should be an "Exclusive Or". You also don't need the case structure. Just initialize the shift register to ZERO. Those local variables are also not necessary. You can get rid of them. Here is a simplified version of what it should look like.
07-19-2018 04:10 AM
Dear jamiva
Yes, the problem was with coma, your simplification are useful and I can now Control the TEMP.
Tanks a lot 🙂
07-19-2018 07:53 AM
Dear jamiva
Can you till me how can I remove the ''B0'' in the string I don't need in the final string see photo attached
07-19-2018 08:29 AM
Hi,
Its just a simple string operation. Just use string replace. Read the String basics in Labview.
07-19-2018 08:42 AM
@SAED123 wrote:
Can you till me how can I remove the ''B0'' in the string I don't need in the final string see photo attached
I'm not sure what you are trying to do. I never used this device, but from what I get reading the protocol, you are going about it all wrong.
The string you are trying to create is actually the RESPONSE back from the CPU. In order to read the analog parameters, you need to instead send the "PCU to CPU" command. Afterwards you would read the response and parse it IAW "CPU to PC".
Here is the syntax to create the PC to CPU Command
07-19-2018 08:54 AM
Thank you dear but I need to read parameter from CPU to PC I generate the string see attach Labview but According to the Protocol in PDF sec.E.2.4 CPU to PC see attach photo.
07-19-2018 09:19 AM
@SAED123 wrote:
Thank you dear but I need to read parameter from CPU to PC I generate the string see attach Labview but According to the Protocol in PDF sec.E.2.4 CPU to PC see attach photo.
You want to READ the parameters from the CPU. Correct?
How do you do that? You need to tell the CPU to send the data to you.
How do you do that? You send the PC to CPU command requesting to data (as I showed you above). It will then send you the data in the format according to CPU to PC protocol.